Skip to content

Number of classes is not equal to 2. ROCR currently supports only evaluation of binary classification tasks. #2

@Violeta-de-Anca

Description

@Violeta-de-Anca

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!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions