We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64ae003 commit 192ba8eCopy full SHA for 192ba8e
sklearnTUT/sk6_model_attribute_method.py
@@ -0,0 +1,20 @@
1
+# View more python learning tutorial on my Youtube and Youku channel!!!
2
+
3
+# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
4
+# Youku video tutorial: http://i.youku.com/pythontutorial
5
6
+from sklearn import datasets
7
+from sklearn.linear_model import LinearRegression
8
9
+loaded_data = datasets.load_boston()
10
+data_X = loaded_data.data
11
+data_y = loaded_data.target
12
13
+model = LinearRegression()
14
+model.fit(data_X, data_y)
15
16
+print(model.predict(data_X[:4, :]))
17
+print(model.coef_)
18
+print(model.intercept_)
19
+print(model.get_params())
20
+print(model.score(data_X, data_y)) # R^2 coefficient of determination
0 commit comments