Skip to content

Instantly share code, notes, and snippets.

@ageitgey
Created September 16, 2014 00:58
Embed
What would you like to do?
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