Skip to content

Commit 50dfa86

Browse files
committed
change comment, printed comment, and code behavior to all reflect computation of mean squared error
1 parent 6f7e351 commit 50dfa86

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/linear_model/plot_ols.py

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

5151
# The coefficients
5252
print('Coefficients: \n', regr.coef_)
53-
# The mean square error
54-
print("Residual sum of squares: %.2f"
55-
% np.sum((regr.predict(diabetes_X_test) - diabetes_y_test) ** 2))
53+
# The mean squared error
54+
print("Mean squared error: %.2f"
55+
% 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))
5858

0 commit comments

Comments
 (0)