eval_metrics print fixed (#4803)
This commit is contained in:
parent
516955564b
commit
830e73901d
@ -19,11 +19,11 @@ def _get_callback_context(env):
|
||||
def _fmt_metric(value, show_stdv=True):
|
||||
"""format metric string"""
|
||||
if len(value) == 2:
|
||||
return '%s:%g' % (value[0], value[1])
|
||||
return '{0}:{1:.5f}'.format(value[0], value[1])
|
||||
if len(value) == 3:
|
||||
if show_stdv:
|
||||
return '%s:%g+%g' % (value[0], value[1], value[2])
|
||||
return '%s:%g' % (value[0], value[1])
|
||||
return '{0}:{1:.5f}+{2:.5f}'.format(value[0], value[1], value[2])
|
||||
return '{0}:{1:.5f}'.format(value[0], value[1])
|
||||
raise ValueError("wrong metric value")
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user