Skip to content

Instantly share code, notes, and snippets.

@edenau
Last active December 27, 2019 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edenau/864dfdc77ee07e687f36f41203ea8332 to your computer and use it in GitHub Desktop.
Save edenau/864dfdc77ee07e687f36f41203ea8332 to your computer and use it in GitHub Desktop.
# Make sure X and y are linearly correlated with normally distributed noise
n = 10000 # 10000 datum points
X = np.random.uniform(-10,10, n)
noise = np.random.normal(0, 3, n) # Gaussian distribution
true_w, true_b = 7.6, -3.3
y = true_w * X + true_b + noise # y = w * x + b + ε
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment