Skip to contents

Holds every feature of x fixed except feature, sweeps it across the range observed in X_ref, and reports the resulting prediction profile.

Usage

morie_fairness_xai_ceteris_paribus(
  predict_fn,
  x,
  feature,
  X_ref,
  feature_names = NULL,
  grid_size = 20L
)

Arguments

predict_fn

Function mapping (n, d) matrix to n predictions.

x

Numeric vector of length d (the instance).

feature

Index or name of the feature to vary.

X_ref

Reference matrix used for the feature range.

feature_names

Optional character vector.

grid_size

Number of grid points.

Value

morie_fairness_result; $value is the profile's swing (max - min).