Hi
Q1: I have been trying to get the AUC value for a classification problem and have been trying to use e1071 and ROCR packages in R for this. ROCR has a nice example "ROCR.simple" which has prediction values and label values.
library(ROCR)
data(ROCR.simple)
pred<-prediction(ROCR.simpe$predictions, ROCR.simple$labels)
auc<-performance(pred,"auc")
This gives the AUC value, no problem.
MY PROBLEM is: How do I get the type of data given by ROCR.simple$predictions
in the above example?
I run my analysis like
library(e1071)
data(iris)
y<-Species
x<-iris[,1:2]
model<-svm(x,y)
pred<-predict(model,x)
Upto here I'm ok.
Then how do I get the kind of predictions that ROCR.simpe$predictions
give?
Q2:
there is a nice example involving ROCR.xvals
. This is a problem with 10 cross validations.
They run
pred<-prediction(ROCR.xval$predictions,ROCR.xval$labels)
auc<-performance(pred,"auc")
This gives results for all 10 cross validations.
My problem is:
How do I use
model<-svm(x,y,cross=10) # where x and y are as given in Q1
and get all 10 results of predictions and labels into a list as given in ROCR.xvals
?