起因
R语言使用train函数训练模型,由于不想用交叉验证,所以可以用在trainControl(method = “none”),但是会报错 Only one model should be specified in tuneGrid with no resampling
原始代码
> train(bbbDescr, logBBB,
method = "earth",
trControl = trainControl(method = "none"))
运行报错 Only one model should be specified in tuneGrid with no resampling
通过固定tuneLength可以解决
train(bbbDescr, logBBB,
method = "earth",
tuneLength = 1,
trControl = trainControl(method = "none"))