Permutation feature importance (model-agnostic)
Source:R/fairness_xai.R
morie_fairness_xai_permutation_importance.RdPermutation feature importance (model-agnostic)
Usage
morie_fairness_xai_permutation_importance(
predict_fn,
X,
feature_names = NULL,
n_repeats = 10L,
protected = NULL,
seed = 0L
)Arguments
- predict_fn
Function mapping an (n, d) matrix to n numeric predictions.
- X
Numeric matrix or data.frame.
- feature_names
Optional character vector.
- n_repeats
Shuffles averaged per feature.
- protected
Character vector of protected-attribute names; any that rank in the top third trigger a bias warning.
- seed
Reproducibility seed.