[英]Is it possible to visualize an individual tree from a random forest obtained via tidymodels?
Good day,再会,
for presentation purposes I would like to plot a couple of decision trees from a random forest (with about 100 trees).出于演示目的,我想 plot 来自随机森林(大约 100 棵树)的几棵决策树。 I found a post from last year where its clear is not really possible or there is not an function using tidymodels.
我发现了去年的一篇文章,其中明确是不可能的,或者没有使用 tidymodels 的 function。 R: Tidymodels: Is it possible to plot the trees for a random forest model in tidy models?
R:Tidymodels:是否可以在整洁的模型中使用 plot 随机森林 model 的树木?
I´m wondering if somebody has found a way, I remember I could easily do this using the "Caret" package.我想知道是否有人找到了方法,我记得我可以使用“插入符号”package 轻松做到这一点。 but tidymodels makes everything so convenient I was hoping for someone with a solution.
但是 tidymodels 让一切变得如此方便,我希望有人能提供解决方案。
Many thanks!非常感谢!
Summarizing what trees can be ploted with tidymodels based in comments comments and other Stackoverflow posts根据评论评论和其他 Stackoverflow 帖子总结可以使用 tidymodels 绘制的树
rpart.plot()
seems to be the most popular.rpart.plot()
似乎是最受欢迎的。You should be able to use a function like
xgb.plot.tree()
with a trained tidymodels workflow or parsnip model by extracting out the underlying object created with the xgboost engine.You should be able to use a function like
xgb.plot.tree()
with a trained tidymodels workflow or parsnip model by extracting out the underlying object created with the xgboost engine. You can do this withextract_fit_engine()
您可以使用
extract_fit_engine()
做到这一点
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.