BUG全文
BUG出现代码背景:
BUG全称:
ValueError: y_true and y_pred contain different number of classes 9, 2. Please provide the true labels explicitly through the labels argument. Classes found in y_true: [0 1 2 3 4 5 6 7 8]
BUG说明
上面报错原因:logloss使用过程中,必须要求将输出用one-hot表示
BUG解决方案
需要将这个多类别问题的输出结果通过OneHotEncoder修改为如下:
- nparray转换
- array数据.OneHot编码转换 (这里面有个坑,spase稀疏矩阵默认为True,图中已标识清晰!!!)