Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“我的插入语中使用了多少棵树?”;rf";模型_R_Random Forest_R Caret - Fatal编程技术网

“我的插入语中使用了多少棵树?”;rf";模型

“我的插入语中使用了多少棵树?”;rf";模型,r,random-forest,r-caret,R,Random Forest,R Caret,在插入符号“rf”模型中未指定ntree计数时,我很难找到模型中使用了多少树 以下是我用来训练我的模型的代码: fitControl <- trainControl( method = "cv", number = 3, savePredictions = "final", classProbs = T,

在插入符号“rf”模型中未指定
ntree
计数时,我很难找到模型中使用了多少树

以下是我用来训练我的模型的代码:

fitControl <- trainControl(
    method = "cv",                     
    number = 3,                        
    savePredictions = "final",         
    classProbs = T,                   
    summaryFunction = twoClassSummary, 
    sampling = "down")                 

set.seed(3219)
  rf_model_down <- train(Class ~ .,
                         data = train_data,
                         method ='rf',
                         tuneLength = 2,
                         trControl = fitControl,
                         metric = "ROC")
提前感谢您,我很难找到一个最简单的答案。

检查
str(rf\u model\u down)
表明我们可以使用

rf_model_down$finalModel$ntree

如果插入符号正在使用随机森林-请参见
rf\u model\u down$modelnfo$library
-默认ntree=500。
rf_model_down$finalModel$ntree