[ERROR]ValueError: multiclass

报错信息:

  File "/。。。7/site-packages/sklearn/metrics/classification.py", line 1059, in f1_score
    sample_weight=sample_weight)
  File "/。。。/site-packages/sklearn/metrics/classification.py", line 1182, in fbeta_score
    sample_weight=sample_weight)
  File "/h。。。hon3.7/site-packages/sklearn/metrics/classification.py", line 1415, in precision_recall_fscore_support
    pos_label)
  File "/h。。。es/sklearn/metrics/classification.py", line 1239, in _check_set_wise_labels
    y_type, y_true, y_pred = _check_targets(y_true, y_pred)
  File "。。。/sklearn/metrics/classification.py", line 88, in _check_targets
    raise ValueError("{0} is not supported".format(y_type))
ValueError: multiclass-multioutput is not supported

 

报错位置:

f1 = f1_score(all_label, all_pred, average='macro')

 

猛地一看,以为这个函数接口不支持多分类

然鹅之前使用多分类评测是没问题的

又查了查其他回答

最终确定是输入数据的问题

输入数据大小,内容不符合预期

 

经过排查改正后,该问题解决

最新回复(0)
/jishuB_2FRf5oAhs12SZE8Zya7ewmsGs4h6lY4iu_2BD7pA_3D_3D4795237
8 简首页