Python:ValueError:无法处理未知和二进制的混合

时间:2017-02-28 04:54:54

标签: python scikit-learn confusion-matrix

我正在使用来自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)

我该怎么办?谢谢。

0 个答案:

没有答案