Use FPDEEngine.explain_batch when you need one attribution row per sample.
Use FPDEEngine.explain_matrix when you only need the attribution matrix.
Explain a batch with details
The matrix has shape (n_samples, n_features).
Each row is an attribution vector for the matching row in X_test.
Explain a batch without details
Use this when you plan to aggregate or save attribution rows and do not need per-sample labels or evidence values.
Keep feature order stable
FPDE assumes every matrix you pass to the engine uses the same feature order.
Apply the same preprocessing pipeline to training, validation, and explanation data.
A feature dimension mismatch means the explanation data does not match the fitted prototype state.
Check scaling, encoding, feature selection, and column order.
Summarize a batch
This ranks features by average absolute attribution magnitude.
It does not change the sign interpretation for each local explanation.
Save reproducible outputs
Save the attribution matrix with enough metadata to recreate it later:
- FPDE version
lambda_hyb
normalize
anchor_strategy
- Feature names and feature order
- Target and rival labels from
details
- Training data or prototype-state source