Skip to content

Instantly share code, notes, and snippets.

@naenumtou
Created November 28, 2022 09:25
Show Gist options
  • Save naenumtou/43e3eb13b7572ec5377dd3e22c4c77c5 to your computer and use it in GitHub Desktop.
Save naenumtou/43e3eb13b7572ec5377dd3e22c4c77c5 to your computer and use it in GitHub Desktop.
# OLS
OLS = LinearRegression()
OLS.fit(X, y.ravel())
# Plot
plt.figure(figsize = (10, 6))
plt.scatter(
X,
y,
c = 'teal'
)
plt.plot(
X,
OLS.predict(X),
c = 'orange',
linewidth = 2,
)
plt.title('OLS Regression')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment