You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
The code for create in metric.py doesn't seem to allow strings to be used for metrics other than accuracy. It checks to see if the type is a string, and if so, checks to see if it's accuracy, and if not, raises an error.
def create(metric):
"""Create an evaluation metric.
Parameters
----------
metric : str or callable
The name of the metric, or a function
providing statistics given pred, label NDArray.
"""
if callable(metric):
return CustomMetric(metric)
if not isinstance(metric, string_types):
raise TypeError('metric should either be callable or str')
if metric == 'acc' or metric == 'accuracy':
return Accuracy()
else:
raise ValueError('Cannot find metric %s' % metric)