Skip to contents

Permutation 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.

Value

morie_fairness_result; $value is the largest importance.