Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/66.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
R 随机森林精度_R_Random Forest - Fatal编程技术网

R 随机森林精度

R 随机森林精度,r,random-forest,R,Random Forest,我使用随机森林算法预测目标变量“Y”有4个值 下面的语法用于创建模型 control <- trainControl(method="repeatedcv", number=2, repeats=1, search="random") seed <- 7 metric <- "Accuracy" set.seed(seed) mtry <- sqrt(ncol(train)) model <- train(Target~., data=complete, metho

我使用随机森林算法预测目标变量“Y”有4个值 下面的语法用于创建模型

control <- trainControl(method="repeatedcv", number=2, repeats=1, search="random")
seed <- 7
metric <- "Accuracy"
set.seed(seed)
mtry <- sqrt(ncol(train))
model <- train(Target~., data=complete, method="rf", metric=metric, tuneLength=15, trControl=control)

如果它是随机的,则控制它,然后反复运行,运行时肯定会得到70%或以上:)我不知道这个API,但你可以尝试增加林中的树数或减小节点大小(树将继续分裂的观察数)。@Tim Biegleisen,谢谢你的建议,我将树的数量增加到2001年,准确率提高了5%,是否有任何方法可以确定需要使用的树的确切数量,从而提高准确率?这确实取决于数据、模型等。当添加更多的树不再带来改善时,停止添加更多的树。