Skip to contents

Extracts out-of-bag (OOB) performance metrics from models fitted with rf(), rf_repeat(), or rf_spatial().

Usage

get_performance(model)

Arguments

model

Model object from rf(), rf_repeat(), or rf_spatial().

Value

Data frame with performance metrics:

  • For rf() and rf_spatial(): columns metric and value

  • For rf_repeat(): columns metric, median, and median_absolute_deviation (MAD across repetitions)

Details

Out-of-bag (OOB) performance is computed using observations not included in bootstrap samples during model training. Metrics typically include R-squared, pseudo R-squared, RMSE, and normalized RMSE. For repeated models, the median and median absolute deviation summarize performance across repetitions.

Examples

data(plants_rf)

# Extract OOB performance metrics
performance <- get_performance(plants_rf)
performance
#>             metric        value
#> 1    r.squared.oob    0.5015626
#> 2        r.squared    0.8378728
#> 3 pseudo.r.squared    0.9153539
#> 4         rmse.oob 2379.2537244
#> 5             rmse 1609.6138000
#> 6            nrmse    0.4646691

# For repeated models, median and MAD are returned
# (example would require rf_repeat model)