View source: R/get_importance.R
| get_importance | R Documentation |
Extracts variable importance scores from models fitted with rf(), rf_repeat(), or rf_spatial().
get_importance(model)
model |
Model object from |
For spatial models (rf_spatial()) with many spatial predictors, this function returns aggregated importance statistics for spatial predictors to improve readability. Non-spatial models return per-variable importance scores directly.
Data frame with columns variable (character) and importance (numeric), sorted by decreasing importance.
rf(), rf_repeat(), rf_spatial(), plot_importance(), print_importance()
Other model_info:
get_evaluation(),
get_importance_local(),
get_moran(),
get_performance(),
get_predictions(),
get_residuals(),
get_response_curves(),
get_spatial_predictors(),
print.rf(),
print_evaluation(),
print_importance(),
print_moran(),
print_performance()
data(plants_rf)
# Extract variable importance
importance <- get_importance(plants_rf)
head(importance)
# View top 5 most important variables
importance[1:5, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.