Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

i have a datasets with 587 rows and 0 column. i do LOOCV for random forest and using "a" vector for plot ROC curve. this is my code for random forest:

a=1:587
for (k in 1:587){
  set.seed(1) 
  a[k] <- predict(randomForest(death ~ ., 
                                         data = df2.imp$ximp[-k,], mtry=4),type="prob", 
                            newdata = df2.imp$ximp[k,,drop=F])[2] 
}

But this for loop doesn't work for SVM classifier . if i run this code , the results is null :

a=1:587
for (k in 1:587){
  set.seed(1) 
  a[k] <- predict(svm(death ~ ., 
                                         data = df2.imp$ximp[-k,]),type="prob", 
                            newdata = df2.imp$ximp[k,,drop=F])[2] 
}

it is important for me to do LOOCV and plot ROC curve . is there another way to do these instead?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
254 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...