Extract a subset of tree from random forest model

2019-08-07 10:21发布

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"

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.

1条回答
姐就是有狂的资本
2楼-- · 2019-08-07 10:54

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

查看更多
登录 后发表回答