Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid MAE value #37

Closed
shedar opened this issue Jul 19, 2017 · 6 comments
Closed

Invalid MAE value #37

shedar opened this issue Jul 19, 2017 · 6 comments

Comments

@shedar
Copy link

shedar commented Jul 19, 2017

MAE value is half of the actual value.

E.g.

train_pool = Pool(x_train, y_train, cat_features=cat_indexes)
valid_pool = Pool(x_valid, y_valid, cat_features=cat_indexes)
test_pool = Pool(x_valid, cat_features=cat_indexes)

model = CatBoostRegressor(iterations=10, depth=6, learning_rate=0.03, loss_function='MAE',verbose=True)
model.fit(train_pool, eval_set=valid_pool, verbose=True)
y_pred = model.predict(test_pool)
sk_err = metrics.mean_absolute_error(y_valid, y_pred)
print("sklearn error:", sk_err)

Output is

bestTest = 0.0346194358
bestIteration = 9

sklearn error: 0.0692388715917

CatBoost version: 0.1.1.5
Python: 3.5.2
OS: OS X 10.12.5

@unnir
Copy link

unnir commented Jul 20, 2017

but, the mse for valid data, yes?

@Donskov7
Copy link

Try to add parameter use_best_model=True to the model and check again.

@shedar
Copy link
Author

shedar commented Jul 20, 2017

@unnir, not 100% sure what you mean, please let me know if I answered a wrong question. RMSE calculated by catboost matches with a value I get from sklearn, but MAE - doesn't.

@Donskov7, here's result with use_best_model=True

bestTest = 0.03309215839
bestIteration = 9

Shrink model to first 10 iterations.
sklearn error: 0.0661843167294

@demikandr
Copy link

MAE loss in catboost is actually MAE/2.

It is so because internally it's a Quantile loss with alpha=0.5.

@annaveronika
Copy link
Contributor

Issue MATRIXNET-758

@annaveronika
Copy link
Contributor

This is fixed now, try updating to the last version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants