问题描述
我有一个数据集“df_train”,其中包含我所有的解释变量和我的目标变量 (xxx1)。此外,我还有另一个数据集,其中包含拟合随机森林(xxx2 列)时要使用的权重。我正在尝试实现 3-fold cv,但似乎有些问题。它说的是类概率,但我正在尝试拟合回归随机森林。我不明白其余的错误是关于什么的。
train_control<- trainControl(method="cv",number=3,savePredictions = TRUE)
model2<- caret::train(xxx1~.,data=df_train,trControl=train_control,weights = train$xxx2,method="ranger",ntree = 64)
Something is wrong; all the RMSE metric values are missing:
RMSE Rsquared MAE
Min. : NA Min. : NA Min. : NA
1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
Median : NA Median : NA Median : NA
Mean :NaN Mean :NaN Mean :NaN
3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
Max. : NA Max. : NA Max. : NA
NA's :6 NA's :6 NA's :6
Error: Stopping
In addition: There were 20 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In train.default(x,y,weights = w,...) :
cannnot compute class probabilities for regression
2: model fit failed for Fold1: mtry= 2,min.node.size=5,splitrule=variance Error in ranger::ranger(dependent.variable.name = ".outcome",data = x,:
unused argument (ntree = 64)
3: model fit failed for Fold1: mtry=32,:
unused argument (ntree = 64)
4: .....
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)