如何在R中可视化随机森林模型输出



是否可以可视化R中的随机林输出?我读过一篇关于python中的export_graphviz库的文章,该库使用输出的n_evaluations参数以DOT格式导出决策树,然后用于生成决策树的图形表示。

我们在R有这样的东西吗?

也许你可以考虑像这样的东西

library(randomForest)
library(reprtree)
model <- randomForest(Species ~ ., data = iris, importance = TRUE, ntree = 500, mtry = 2, do.trace = 100)
reprtree:::plot.getTree(model)

(参见https://stats.stackexchange.com/questions/41443/how-to-actually-plot-a-sample-tree-from-randomforestgettree)

最新更新