Skip to content

Commit 192ba8e

Browse files
author
Mofan Zhou
committed
create sk6
1 parent 64ae003 commit 192ba8e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
+20
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)