在过去的几天里,我开始熟悉R(我来自MATLAB和Python)。我想尝试插入符号包(非常棒),当我尝试使用LOOCV进行训练时,我不断收到以下错误消息
Error in `[.data.frame`(tuneAcc, , params, drop = FALSE) :
undefined columns selected
现在,一开始我以为“好,我在这里做错了”。但是后来我使用了来自http://machinelearningmastery.com/的代码:
library(caret)
# load the iris dataset
data(iris)
# define training control
train_control <- trainControl(method="LOOCV")
# train the model
model <- train(Species~., data=iris, trControl=train_control, method="nb")
# summarize results
print(model)
返回相同的错误。完整代码可在以下地址找到:http://machinelearningmastery.com/how-to-estimate-model-accuracy-in-r-using-the-caret-package/。我搞砸了R的安装吗?难道我做错了什么?
这是print.train函数中的错误。另请参见github上的第435期。它应在下一个插入符号的更新(6.0-70或更高版本)中修复。
顺便说一句,该模型没有错。您仍然可以使用它进行预测。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句