一、问题
进行建模和交叉验证后,当我想得到classification_report时,
classification_report(y_valid, pred_valid, target_names=col_y))
遇到了这个错误:
ValueError: Mix of label input types (string and number)
二、解决方式
可以将预测标签和真实标签都转换为str
:
classification_report(y_valid.astype(str), pred_valid.astype(str), target_names=col_y))