Skip to contents

Gets variable importance scores from rf(), rf_repeat(), and rf_spatial() models.

Usage

get_importance(model)

Arguments

model

A model fitted with rf(), rf_repeat(), or rf_spatial(). Default: NULL

Value

A data frame with variable names and importance scores.

Examples


data(plant_richness_df)
data(distance_matrix)

rf.model <- rf(
  data = plant_richness_df,
  dependent.variable.name = "richness_species_vascular",
  predictor.variable.names = colnames(plant_richness_df)[5:21],
  distance.matrix = distance_matrix,
  distance.thresholds = 0,
  n.cores = 1,
  verbose = FALSE
)

x <- get_importance(rf.model)
x
#>                           variable importance
#> 1                 human_population   2026.102
#> 2             climate_bio1_average   1831.466
#> 3              climate_hypervolume   1444.210
#> 4         human_population_density   1359.632
#> 5                    bias_area_km2   1209.525
#> 6          human_footprint_average    976.333
#> 7                  neighbors_count    846.447
#> 8          bias_species_per_record    719.243
#> 9    climate_aridity_index_average    695.705
#> 10                  neighbors_area    676.818
#> 11    climate_velocity_lgm_average    631.907
#> 12   neighbors_percent_shared_edge    628.314
#> 13          fragmentation_cohesion    619.986
#> 14    topography_elevation_average    615.590
#> 15          fragmentation_division    483.461
#> 16           climate_bio15_minimum    373.095
#> 17 landcover_herbs_percent_average    358.212