View source: R/compute_metrics.R
compute_covariate_metric | R Documentation |
Function for computing the fit metric from \insertCitebanerjee:2012;textualTreeTracer.
compute_covariate_metric(rf, max_depth = NULL)
rf |
randomForest object from which to compute distances between trees |
max_depth |
an option to set the maximum tree depth to consider when comparing trees (set to NULL by default) |
banerjee:2012TreeTracer
# Load packages
library(palmerpenguins)
# Load the Palmer penguins data
penguins <- na.omit(penguins)
# Fit a random forest
set.seed(71)
penguin_rf <-
randomForest::randomForest(
species ~ bill_length_mm + bill_depth_mm + flipper_length_mm + body_mass_g,
data = penguins,
ntree = 5
)
# Compute fit metrics between all trees
compute_covariate_metric(penguin_rf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.