Hello!
I came here as I had the same problem as another person 2 years ago. I am trying using ROCR to do a ROC plot.
For one of the plots when I try to compute prediction it gives me this error:
Number of classes is not equal to 2.
ROCR currently supports only evaluation of binary classification tasks.
My labels for this one are all 1:
lab.F1
[1] 1 1 1 1 1 1 1 1 1 1 1
It the old issue it is said that it was already solved, so I don't know?
I tried to define first a factor with the two levels but gives the same error....
The code that I am using:
predict.F1=prediction(pre.F1,lab.F1)
lab.F1=c(1 1 1 1 1 1 1 1 1 1 1)
pre.F1=c(1.099987e+00 1.099987e+00 1.099987e+00 1.099987e+00 1.099987e+00 1.099991e+00 9.511482e-08 1.099991e+00 1.099991e+00 1.099991e+00 1.099991e+00)
(pre.F1 is named num class)
Thank you so much!!
Hello!
I came here as I had the same problem as another person 2 years ago. I am trying using ROCR to do a ROC plot.
For one of the plots when I try to compute prediction it gives me this error:
Number of classes is not equal to 2.
ROCR currently supports only evaluation of binary classification tasks.
My labels for this one are all 1:
lab.F1
[1] 1 1 1 1 1 1 1 1 1 1 1
It the old issue it is said that it was already solved, so I don't know?
I tried to define first a factor with the two levels but gives the same error....
The code that I am using:
predict.F1=prediction(pre.F1,lab.F1)
lab.F1=c(1 1 1 1 1 1 1 1 1 1 1)
pre.F1=c(1.099987e+00 1.099987e+00 1.099987e+00 1.099987e+00 1.099987e+00 1.099991e+00 9.511482e-08 1.099991e+00 1.099991e+00 1.099991e+00 1.099991e+00)
(pre.F1 is named num class)
Thank you so much!!