Message-ID: <BANLkTin3vfN18Crd2+kS1vcwonXDX1=oKA@mail.gmail.com>
Date: 2011-04-15T15:00:35Z
From: Soyeon Kim
Subject: prediction error in ROCR package when sampled y consists of only one class
Dear R users,
Hi. I am using prediction function in ROCR package.
y consists of two classes 0 and 1.
However, since I am using cross-validation, a sampled small number of
y may consist of only one class
>y
[1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
In this case, prediction function gives an error:
Error in prediction(predic, y) : Number of classes is not equal to 2.
ROCR currently supports only evaluation of binary classification tasks.
How can I solve this problem?
Thank you,
Soyeon Kim