我使用 reprtree 包绘制了随机森林树,如下所示,
model23 <- randomForest(active ~ total_gross_amt + frequency + t_shirt, data = mydata)
reprtree:::plot.getTree(model23)
随机森林 TreeMap :
但我无法从树中解释任何内容。
是否有任何方法可以减少树的大小或任何其他方法可以用代码在 R 中绘制单个随机森林树?
提前致谢。 巴拉吉
最佳答案
晚了 2 年,但它可能对其他人有帮助。
转到 plots 选项卡 > export > save as image > width = 1500, height = 900,不要忘记勾选“view plot after saving”并点击保存
关于减少 R 中随机森林 TreeMap 的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49110704/