[英]How to visualize random forest model output in R?
Is there anyway to visualize a random forest output in R?有没有办法在 R 中可视化随机森林 output? I read a article that talks about the
export_graphviz
library in python that uses an output's n_estimators parameter to export the decision tree in a DOT format which then is used to generate a graphical representation of the decision tree.我在 python 中阅读了一篇关于
export_graphviz
库的文章,该文章使用输出的 n_estimators 参数以 DOT 格式导出决策树,然后用于生成决策树的图形表示。
Do we have anything like this in R?我们在 R 有这样的东西吗?
Maybe you can consider something like也许你可以考虑像
library(randomForest)
library(reprtree)
model <- randomForest(Species ~ ., data = iris, importance = TRUE, ntree = 500, mtry = 2, do.trace = 100)
reprtree:::plot.getTree(model)
(see https://stats.stackexchange.com/questions/41443/how-to-actually-plot-a-sample-tree-from-randomforestgettree ) (参见https://stats.stackexchange.com/questions/41443/how-to-actually-plot-a-sample-tree-from-randomforestgettree )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.