Created
September 16, 2014 00:58
-
-
Save ageitgey/1d85f8482953be37d9c3 to your computer and use it in GitHub Desktop.
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
from sklearn import linear_model | |
X = [ | |
[4,3,1,0,1], | |
[5,2,1,0,1], | |
[4,2,1,1,1], | |
[3,1,0,1,1], | |
[1,1,0,1,1] | |
] | |
y = [4, 6, 6, 3, 1] | |
clf = linear_model.LinearRegression() | |
clf.fit (X, y) | |
print clf.coef_ | |
# [ 1. -1. 3. 1. 0.] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment