2
Q1: 我一直在嘗試獲取分類問題的AUC值,並一直試圖在R中使用e1071和ROCR包。 ROCR有一個很好的例子「ROCR.simple」,它有預測值和標籤值。如何從e1071包中運行svm得到預測列表
library(ROCR)
data(ROCR.simple)
pred<-prediction(ROCR.simpe$predictions, ROCR.simple$labels)
auc<-performance(pred,"auc")
這給出了AUC值,沒有問題。 我的問題是:如何獲得ROCR.simple$predictions
在上例中給出的數據類型? 我運行我的分析就像
library(e1071)
data(iris)
y<-Species
x<-iris[,1:2]
model<-svm(x,y)
pred<-predict(model,x)
高興在這裏我很好。 那我該如何得到ROCR.simpe$predictions
給出的那種預測呢?
Q2:
有涉及ROCR.xvals
一個很好的例子。這是10個交叉驗證的問題。
他們跑得
pred<-prediction(ROCR.xval$predictions,ROCR.xval$labels)
auc<-performance(pred,"auc")
這給了所有10個交叉驗證結果。
我的問題是:
如何使用
model<-svm(x,y,cross=10) # where x and y are as given in Q1
,並得到預測和標籤的所有10個結果到一個列表中給出ROCR.xvals
?