pratik kandalgaonkar
pratik kandalgaonkar

Reputation: 43

Why is there a neg_mean_absolute_error while cross validating, but no mean_absolute_error?

why negative mean absolute error, and not just mean absolute error, what is the significance of negative mean absolute error over mean absolute error?

from sklearn.model_selection import cross_val_score

cv_mae=-cross_val_score(lm,
                        x_train,y_train,
                        cv=10,
                        scoring='neg_mean_absolute_error')

cv_mae

Upvotes: 0

Views: 464

Answers (1)

Andrey Lukyanenko
Andrey Lukyanenko

Reputation: 3851

Sklearn optimization algorithms aim to maximize metrics. As a result, if a metric is supposed to be minimized, they have a negative sign in sklearn.

Upvotes: 1

Related Questions