r语言 tunerf_R语言运行出现问题 求助各位大神

在使用R语言运行tunerf时遇到错误:至少有一个类级别不是有效的R变量名,这会在生成类别概率时引起错误。另外,警告消息提示在trControl中未定义索引。代码涉及到`trainControl`、`caretList`等多个函数,尝试进行交叉验证和多种模型训练。求助如何解决这个问题。
摘要由CSDN通过智能技术生成

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

R语言运行出现下面的问题:

Error: At least one of the class levels is not a valid R variable name; This will cause errors when class probabilities are generated because the variables names will be converted to X0, X1 . Please use factor levels that can be used as valid R variable names (see ?make.names for help).

In addition: Warning message:

In trControlCheck(x = trControl, y = target) :

indexes not defined in trControl. Attempting to set them ourselves, so each model in the ensemble will have the same resampling indexes.

代码为:

ctrl= trainControl(method = "repeatedcv",number = 10,

repeats=5,search="random",

summaryFunction = twoClassSummary,

classProbs = TRUE, savePredictions = "final")

model_list=caretList(

ST~.,data=train,

trControl=ctrl,

metric="ROC",

preProcess=c("center","scale"),

methodList=c("glm","glmnet","pls","lda","pam",

"mda","fda","svmRadialCost","knn","nb","rf","xgbLinear","xgbTree"),

tuneList = list(nnet=caretModelSpec(method="nnet",trace=F)))

results

summary(results)

dotplot(results)

modelCor(results)

splom(results)

请问各位大神如何解决?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值