Skip to content

Latest commit

 

History

History
12 lines (11 loc) · 331 Bytes

6. Linear Regression.md

File metadata and controls

12 lines (11 loc) · 331 Bytes
lr = LinearRegression().fit(X_train,y_train)
y_train_pred = lr.predict(X_train)
y_test_pred = lr.predict(X_test)

#print score
print("lr.coef_: {}".format(lr.coef_))
print("lr.intercept_: {}".format(lr.intercept_))
print('lr train score %.3f, lr test score: %.3f' % (
lr.score(X_train,y_train),
lr.score(X_test, y_test)))