Skip to content

Commit

Permalink
Fix early stopping behavior with MAPE metric (#7061)
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Jun 25, 2021
1 parent 8fa32fd commit dd4db34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python-package/xgboost/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def minimize(new, best):
# user to decide.
maximize_metrics = ('auc', 'aucpr', 'map', 'ndcg', 'auc@',
'aucpr@', 'map@', 'ndcg@')
if any(metric.startswith(x) for x in maximize_metrics):
if metric != 'mape' and any(metric.startswith(x) for x in maximize_metrics):
self.maximize = True
else:
self.maximize = False
Expand Down

0 comments on commit dd4db34

Please sign in to comment.