Add AUC-PR to list of metrics to maximize for early stopping (#3936)

This commit is contained in:
Philip Hyunsu Cho 2018-11-23 12:15:34 -08:00 committed by GitHub
parent 86aac98e54
commit 7d3149a21f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,8 +188,8 @@ def early_stop(stopping_rounds, maximize=False, verbose=True):
msg = ("Multiple eval metrics have been passed: "
"'{0}' will be used for early stopping.\n\n")
rabit.tracker_print(msg.format(env.evaluation_result_list[-1][0]))
maximize_metrics = ('auc', 'map', 'ndcg')
maximize_at_n_metrics = ('auc@', 'map@', 'ndcg@')
maximize_metrics = ('auc', 'aucpr', 'map', 'ndcg')
maximize_at_n_metrics = ('auc@', 'aucpr@' 'map@', 'ndcg@')
maximize_score = maximize
metric_label = env.evaluation_result_list[-1][0]
metric = metric_label.split('-', 1)[-1]