8.52 Variable importance
The broomstick
package (https://github.com/njtierney/broomstick/) enables the analyst to extract the decision tree variable importance from the fitted model.
::tidy(reg_tree_final_fit$fit$fit) %>%
broomstickmutate(variable = variable %>% as_factor() %>% fct_rev()) %>%
ggplot(aes(y = variable, x = importance)) +
geom_col(fill = "steelblue")