0
$\begingroup$

The string "mean_squared_error" appears to be deprecated in cross_val_score now, and it's saying to use neg_mean_squared_error. Is this metric literally just the negative of the MSE?

$\endgroup$
2
$\begingroup$

You are right, neg_mean_squared_error is simple -1 * mean_squared_error. This is because a convention in the Scikit-learn api that all the scorers follow.

According to scikit-learn documentation (some emphasis added):

For the most common use cases, you can designate a scorer object with the scoring parameter; the table below shows all possible values. All scorer objects follow the convention that higher return values are better than lower return values. Thus metrics which measure the distance between the model and the data, like metrics.mean_squared_error, are available as neg_mean_squared_error which return the negated value of the metric.

$\endgroup$
2
  • $\begingroup$ When it says "higher return values are better than lower return values," does this mean "higher in MAGNITUDE?" If not, then for negative values, smaller in magnitude would mean "higher." $\endgroup$
    – roulette01
    Apr 25 at 18:09
  • $\begingroup$ You cannot have negative values in the mean squared error by definition mean(y - y_hat)**2 will always be positive, so in principle, the higher the worst the model is, when multiplied by -1 the magnitude is inverted so that higher values will imply a better fit, and as above states, this is only for metrics that measure the distance between the model and the data $\endgroup$ Apr 25 at 18:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.