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

early stopping criteria not working with eval_metric "aucpr" #3712

Closed
ankurkhurana03 opened this issue Sep 19, 2018 · 8 comments
Closed

early stopping criteria not working with eval_metric "aucpr" #3712

ankurkhurana03 opened this issue Sep 19, 2018 · 8 comments

Comments

@ankurkhurana03
Copy link

The metrics aucpr should increase for the convergence, whereas the metrics required for early stopping criteria should be minimized;

@hcho3
Copy link
Collaborator

hcho3 commented Sep 19, 2018

Try setting maximize=True when calling xgboost.train().

@ankurkhurana03
Copy link
Author

thanks, that worked!

@imranahmed96
Copy link

imranahmed96 commented Nov 23, 2018

I'm actually not sure maximize works when using the Scikit-Learn API for XGBoost

If you set maximize = True in the XGBClassifuer, and then set eval_metric = 'aucpr' in the .fit, this will not work. However, it will work if you use auc instead of aucpr

@hcho3
Copy link
Collaborator

hcho3 commented Nov 23, 2018

@imranahmed96 Indeed, it is not possible to set maximize parameter in scikit-learn interface; it will be silently ignored. I will submit a fix so that aucpr gets automatically maximized.

@imranahmed96
Copy link

@hcho3 Thank-you for the lightning-fast reply! Perfect, that sounds great! 😄

@batmaxx
Copy link

batmaxx commented Feb 27, 2019

@hcho3 is the change already available?

@hcho3
Copy link
Collaborator

hcho3 commented Feb 27, 2019

@batmax2015 The change is not part of the stable 0.81 release. It will be part of the upcoming 0.82 release. You should use the latest source in the mean time.

@johntiger1
Copy link

johntiger1 commented May 25, 2019

Still not working for me (for auc-pr)

As an aside, why will it work for regular auc? @imranahmed96

If you set maximize = True in the XGBClassifuer, and then set eval_metric = 'aucpr' in the .fit, this will not work. However, it will work if you use auc instead of aucpr

@lock lock bot locked as resolved and limited conversation to collaborators Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants