Created
December 30, 2017 21:50
-
-
Save anonymous/e2907b1b75c54d66792499cb7b5e00b3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from sklearn import linear_model, datasets | |
#digit dataset from sklearn | |
digits = datasets.load_digits() | |
#create the LinearRegression model | |
clf = linear_model.LinearRegression() | |
#set training set | |
x, y = digits.data[:-1], digits.target[:-1] | |
#train model | |
clf.fit(x, y) | |
#predict | |
y_pred = clf.predict([digits.data[-1]]) | |
y_true = digits.target[-1] | |
print(y_pred) | |
print(y_true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment