Created
December 19, 2018 10:53
-
-
Save GermanCM/4f1fe068bd9a0727826dd7478c03fdb0 to your computer and use it in GitHub Desktop.
linear regression via scikit-learn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def linear_regression_via_scikit(X_train, y_train): | |
from sklearn import linear_model | |
linear_reg = linear_model.LinearRegression() | |
linear_reg.fit(X_train.values.reshape((len(X_train),1)), y_train.values.reshape((len(X_train),1))) | |
return linear_reg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment