Skip to content

Commit 62b48b9

Browse files
committed
Merge pull request scikit-learn#5954 from KjellSwedin/correct_LinearRegression_example
residual sum of squares should be computed by summing the squared dif…
2 parents f63ac6e + 50dfa86 commit 62b48b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/linear_model/plot_ols.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050

5151
# The coefficients
5252
print('Coefficients: \n', regr.coef_)
53-
# The mean square error
54-
print("Residual sum of squares: %.2f"
53+
# The mean squared error
54+
print("Mean squared error: %.2f"
5555
% np.mean((regr.predict(diabetes_X_test) - diabetes_y_test) ** 2))
5656
# Explained variance score: 1 is perfect prediction
5757
print('Variance score: %.2f' % regr.score(diabetes_X_test, diabetes_y_test))

0 commit comments

Comments
 (0)