该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
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)
请问各位大神如何解决?