【发布时间】:2021-10-19 03:19:54
【问题描述】:
我尝试使用 R 运行 10 倍套索回归,但是当我运行 tuneGrid 时,它显示了这个错误,我不知道如何修复它。这是我的代码:
ctrlspecs<-trainControl(method="cv",number=10, savePredictions="all", classProb=TRUE)
lambdas<-c(seq(0,2,length=3))
foldlasso<-train(y1~x1,data=train_dat, method="glm", mtryGrid=expand.grid(alpha=1,lambda=lambdas),
trControl=ctrlspecs,tuneGrid=expand.grid(.alpha=1,.lambda=lambdas),na.action=na.omit)
【问题讨论】: