Skip to content

Instantly share code, notes, and snippets.

@clementpoiret
Created February 9, 2020 17:56
Show Gist options
  • Save clementpoiret/f21bb90e784407362fbabab327ce0c95 to your computer and use it in GitHub Desktop.
Save clementpoiret/f21bb90e784407362fbabab327ce0c95 to your computer and use it in GitHub Desktop.
# Showing data, alongside prediction
x = np.linspace(0, 2, 10).reshape(-1, 1)
y_truth = gradient * x + w0
y_estimated = model.coef_ * x + model.intercept_
plt.scatter(X_train, y_train, label="Data")
plt.plot(x, y_truth, label="Truth")
plt.plot(x, y_estimated, label="Model")
plt.legend();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment