add R2 evaluation for linear_regression
it will help to know the regression presicison
This commit is contained in:
@ -29,3 +29,6 @@ regressor.fit(X_train, Y_train)
|
|||||||
# Predicting the Test set results
|
# Predicting the Test set results
|
||||||
y_pred = regressor.predict(X_test)
|
y_pred = regressor.predict(X_test)
|
||||||
|
|
||||||
|
# regression evaluation
|
||||||
|
from sklearn.metrics import r2_score
|
||||||
|
print(r2_score(Y_test,y_pred))
|
||||||
|
|||||||
Reference in New Issue
Block a user