我正在使用来自sklearn的confusion_matrix,我有以下错误:
Traceback (most recent call last):
File "...", line 363, in <module>
confusionMatrix = confusion_matrix(Yt , Yint)
File "C:\Python27\lib\site-packages\sklearn\metrics\classification.py", line 240, in confusion_matrix
y_type, y_true, y_pred = _check_targets(y_true, y_pred)
File "C:\Python27\lib\site-packages\sklearn\metrics\classification.py", line 82, in _check_targets
"".format(type_true, type_pred))
ValueError: Can't handle mix of unknown and binary
我的代码:
for accuracyt in range(len(inputMappingTest)):
if Y[accuracyt] > 0:
Yint[accuracyt] = 1
else:
Yint[accuracyt] =- 1
Yt = numpy.asarray(Yt)
confusionMatrix = confusion_matrix(Yt , Yint)
我该怎么办?谢谢。