get_varimp: Get variable importance

get_varimpR Documentation

Get variable importance

Description

The variable importance measures a fitted model reports, or the mean absolute contribution of each predictor in a SHAP explanation.

Usage

get_varimp(x, ...)

Arguments

x

Supervised, SupervisedRes or SHAP object.

...

Additional arguments passed to methods.

Details

A VariableImportance object holds its measures by name in ⁠@measures⁠. Each measure states what it quantifies (⁠@kind⁠, for example split gain, permutation, or coefficient), the cases it was computed on (⁠@computed_on⁠), whether its values can be negative (⁠@signed⁠) or depend on the units of the predictors (⁠@scale_dependent⁠), how it ranks predictors (⁠@direction⁠), and what its values are for this model (⁠@description⁠); ⁠@values⁠ holds the value for each predictor. varimp_table combines the measures into one data.frame.

Value

VariableImportance object, a list of them (one per resample) for a SupervisedRes, or NULL when the algorithm reports no importance.

Author(s)

EDG

Examples

mod <- train(iris, hyperparameters = setup_LightRF())
get_varimp(mod)

rtemis documentation built on Oct. 20, 2026, 1:06 a.m.