Early stopping returns minimum value if the eval_metric is AUCPR


#1

Hello Everyone,

I’m performing xgboost with eval_metric as ‘aucpr’ and early_stopping_rounds = 20.

When performing the early stopping it is only checking for the minimum value and returning if the value does not decrease, but the case should be it should pick up the maximum value instead. Can you please let me know the workaround.

Thanks,
Vivek.


#2

You should add the parameter maximize = True during training.


#3

I’m using python API XGBClassifier (https://xgboost.readthedocs.io/en/latest/python/python_api.html#module-xgboost.sklearn) which does not has maximize parameter.


#4

In latest version, AUCPR is maximized in early stopping:

Can you double check if you are using a recent version of XGBoost?


#5

Thank you very much. I was using old version