-
-
Save leao-nardo/c450dda8f8af9b305e752ce708e594fc 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