Skip to content

Commit

Permalink
Revert changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Dec 17, 2020
1 parent d37bce0 commit b6d2b35
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions python-package/xgboost/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def init(env):
rabit.tracker_print(msg.format(metric_label, stopping_rounds))

state['maximize_score'] = maximize_score

state['best_iteration'] = 0
if maximize_score:
state['best_score'] = float('-inf')
else:
Expand All @@ -228,11 +228,9 @@ def init(env):
state['best_iteration'] = int(bst.attr('best_iteration'))
state['best_msg'] = bst.attr('best_msg')
else:
state['best_iteration'] = 0
bst.set_attr(best_iteration=str(state['best_iteration']))
bst.set_attr(best_score=str(state['best_score']))
else:
state['best_iteration'] = 0
assert env.cvfolds is not None

def callback(env):
Expand Down

0 comments on commit b6d2b35

Please sign in to comment.