在 RFE 插入符号包中选择特征后,是否可以为最佳模型绘制 ROC 曲线?
我的代码如下:
set.seed(12)
rfFuncs$summary <- twoClassSummary
rfeControl = rfeControl(rfFuncs)
trainctrl <- trainControl(classProbs= TRUE, summaryFunction =
twoClassSummary, savePredictions = TRUE)
control <- rfeControl(functions=rfFuncs, method="LOOCV",
returnResamp="final")
feat.sel <- rfe(bd_ud[, c(1:10)], bd_ud$diagnosis,
sizes=c(1:10), rfeControl=control, method="svmLinear", metric =
"ROC", trControl=trainctrl)
print(feat.sel)
predictors(feat.sel)
plot(feat.sel, type=c("g", "o"))
结果:
Resampling performance over subset size:
Variables ROC Sens Spec Selected
1 0.5101 0.6481 0.5185
2 0.6337 0.5000 0.5926
3 0.6980 0.6296 0.6667 *
4 0.6373 0.5741 0.6111
5 0.6349 0.5741 0.6111
6 0.6727 0.6296 0.5926
7 0.6406 0.5741 0.5926
8 0.6307 0.5926 0.5556
9 0.6557 0.5926 0.6111
10 0.6044 0.5741 0.5926
如何绘制选择 3 个变量(AUC=0.6980)的模型的 ROC 曲线?