When I ran this code, I encountered a problem that:
ValueError: Target is multiclass but average='binary'. Please choose another average setting, one of [None, 'micro', 'macro', 'weighted']
ValueError: Target is multiclass but average='binary'. Please choose another average setting, one of [None, 'micro', 'macro', 'weighted']
.
anyone knows?
This notebook uses inspect
unit to assign proper scorer arguments, and it seems the api has changed since the notebook was published. Specifically at this point:
def calculate_metric(metric_fn, true_y, pred_y):
if "average" in inspect.getfullargspec(metric_fn).args:
...
'average'
is not in the args
list anymore. Using inspect.getfullargspec(metric_fn).kwonlyargs
instead should fix the issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.