【发布时间】:2019-11-17 06:13:28
【问题描述】:
我在学习randomforest时遇到了这种错误。
library(caret)
library(randomForest)
rf_model_housing <-train(SalePrice ~., # Standard formula notation
data=train_housing[,-1],
method="rf",
nodesize= 10,
mtry= 5,
ntree = 500,
trControl=trainControl(method="repeatedcv", number=2,repeats=1),
tuneGrid = expand.grid(mtry = c(123)))
错误:正在停止 另外:警告信息: 1:Fold1.Rep1 的模型拟合失败:mtry=123 randomForest.default(x, y, mtry = param$mtry, ...) 中的错误: 由多个实际参数匹配的形式参数“mtry” 2:Fold2.Rep1 的模型拟合失败:mtry=123 randomForest.default(x, y, mtry = param$mtry, ...) 中的错误: 由多个实际参数匹配的形式参数“mtry” 3:在nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, :Resampled performance measure 中有缺失值。
【问题讨论】:
-
尝试删除
mtry = 5
标签: r random-forest