Fix uninitialized value bug in xgboost callback (#5463)
Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
parent
468b1594d3
commit
6a169cd41a
@ -209,6 +209,10 @@ def early_stop(stopping_rounds, maximize=False, verbose=True):
|
|||||||
state['best_score'] = float('-inf')
|
state['best_score'] = float('-inf')
|
||||||
else:
|
else:
|
||||||
state['best_score'] = float('inf')
|
state['best_score'] = float('inf')
|
||||||
|
msg = '[%d]\t%s' % (
|
||||||
|
env.iteration,
|
||||||
|
'\t'.join([_fmt_metric(x) for x in env.evaluation_result_list]))
|
||||||
|
state['best_msg'] = msg
|
||||||
|
|
||||||
if bst is not None:
|
if bst is not None:
|
||||||
if bst.attr('best_score') is not None:
|
if bst.attr('best_score') is not None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user