I am using pROC (in R) with the function multiclass.roc as pointed out at the thread How to plot ROC curves in multiclass classification?
However, when I applied to my data, there is an error:
predictor must be numeric or ordered
Obviously my data label is non - ordered, in this case, how could I calculate AUC?
P/S: The idea is, I have a confusion matrix as the result of a multi-class classifier. How can I calculate AUC for this confusion matrix in R?
Update1:
Let's say I have 4 classes A, B, C, D without order (i.e, does not mean that A > B or B > A)
The correct values:
A A A B B C D A B C D A B C ...
The predicting values:
A B A B B B C D ...
How should I calculate AUC for this data?
Update 2
The code to generate the sample data:
x = c(rep("A",50),rep("B",50),rep("C",50),rep("D",50))
x = as.factor(x)
x_true = sample(x)
x_predict = sample (x)
Then I tried
library (pROC)
multiclass.roc(x_true, x_predict)
Error in roc.default(response, predictor, levels = X, percent = percent, :
Predictor must be numeric or ordered.