Created
September 16, 2014 00:58
-
-
Save ageitgey/1d85f8482953be37d9c3 to your computer and use it in GitHub Desktop.
Revisions
-
ageitgey created this gist
Sep 16, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ 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.]