Skip to content

fippy/importance-on-training-rows

Pack Severity Fix Versions
fippy warning none, edit by hand All versions

Predictive feature importance (LOCO, SAGE, PFI, CFI, RFI) measures how much held-out loss degrades when a feature or feature group is removed or perturbed. Evaluating on X_train measures in-sample fit rather than generalization.

res = explainer.loco(X_train, y_train, learner=est)
res = explainer.loco(X_val, y_val, learner=est)

Calls to .loco(), .pfi(), .cfi(), .rfi(), .sage(), .loo(), or .shapley() passing a training-named feature matrix as X.

Pass held-out validation or future-period observations (X_val, y_val) to the importance call while keeping (X_train, y_train) in Explainer and set_y_train.

Computing fippy feature importance on training rows ($X) measures in-sample training loss change rather than held-out predictive value. Evaluate importance on held-out validation or future delivery rows instead.

See all rules in the fippy pack.