Plot XGBoost tree visualization
Value
The return value of xgb.plot.tree, a
tree diagram rendered via the DiagrammeR package.
Examples
# \donttest{
if (requireNamespace("xgboost", quietly = TRUE) &&
requireNamespace("DiagrammeR", quietly = TRUE)) {
model <- tl_model(iris, Species ~ ., method = "xgboost", nrounds = 10)
# tree_index is zero-based, so this is the first tree
tl_plot_xgboost_tree(model, tree_index = 0)
}
#> Warning: Passed unrecognized parameters: tree_index. This warning will become an error in a future version.
# }
