scikit-learn cross validation, negative values with mean squared error

Trying to close this out, so am providing the answer that David and larsmans have eloquently described in the comments section:

Yes, this is supposed to happen. The actual MSE is simply the positive version of the number you’re getting.

The unified scoring API always maximizes the score, so scores which need to be minimized are negated in order for the unified scoring API to work correctly. The score that is returned is therefore negated when it is a score that should be minimized and left positive if it is a score that should be maximized.

This is also described in sklearn GridSearchCV with Pipeline.

Leave a Comment