View source: R/compute_metrics.R
compute_fit_metric | R Documentation |
Function for computing the fit metric from \insertCitechipman:1998;textualTreeTracer.
compute_fit_metric(rf, data)
rf |
randomForest object from which to compute distances between trees |
data |
data frame with predictor variables used to fit the model (does not need to be the training data) |
chipman:1998TreeTracer
# 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 = 10
)
# Compute fit metrics between all trees
compute_fit_metric(penguin_rf, penguins)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.