问题描述
让我们考虑数据
set.seed(20)
y <- sample(0:1,100,replace = T)
x <- data.frame(rnorm(100),rexp(100))
我想执行交叉验证和输出敏感性和特异性。我发现我可以为训练函数“度量”提供额外的输入来指定我想要的度量。所以:
# train the model on training set
library(caret)
cross <- train(as.factor(y) ~ .,data = cbind(y,x),metric = 'Sensitivity',trControl = trainControl(method = "cv",number = 5),method = "glm",family = binomial()
)
但是我看到了问题:
The metric "Sensitivity" was not in the result set. Accuracy will be used instead.
是否有任何解决方案如何在交叉验证中使用灵敏度和特异性?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)