本文介绍了从随机森林模型中提取树的子集进行预测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据RF论文Liaw的分类和回归,确定需要多少棵树的最佳方法是将森林的预测与森林的子集的预测进行比较

From Liaw's classification and regression by RF paper, "The best way to determine how many trees are necessary is to compare predictions made by a forest to predictions made by a subset of forest"

我想知道是否有一种方法可以使用R的randomForest包提取子树进行预测。 getTree似乎可以打印出结构。任何建议将不胜感激。

I am wondering if there is a way to extract subtree for prediction with R's randomForest package. getTree seems to print out the structure. Any suggestion would be greatly appreciated.

推荐答案

randomForest predict(rf,dat, Forecast.all = TRUE),您可以从所有子树中获得预测。

Try this one in randomForest, predict(rf, dat, predict.all=TRUE), you can get predictions from all the sub trees.

这篇关于从随机森林模型中提取树的子集进行预测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 18:50