简体   繁体   中英

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). I found a post from last year where its clear is not really possible or there is not an function using tidymodels. R: Tidymodels: Is it possible to plot the trees for a random forest model in tidy models?

I´m wondering if somebody has found a way, I remember I could easily do this using the "Caret" package. but tidymodels makes everything so convenient I was hoping for someone with a solution.

Many thanks!

Summarizing what trees can be ploted with tidymodels based in comments comments and other Stackoverflow posts

  • Decision trees. There are some options but the function rpart.plot() seems to be the most popular.
  • Individual tree from a random forest. Doesn´t seem to be possible to plot one (yet) using the tidymodel environment. See this post: here
  • XGBoost models: See Julia comment:

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 with extract_fit_engine()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM