This guide trains a scikit-learn classifier, fits an FPDE engine on the training data, and explains one test sample.
The example uses the breast cancer dataset bundled with scikit-learn.
Prerequisites
Before you begin, install:
- Python 3.12 or newer
pip
- A classifier that exposes
predict_proba and classes_
Get started
Train a classifier
Train a classifier on the same feature space you want to explain. Fit FPDE
Fit reusable FPDE state from the training data and labels. Explain one sample
Explain one test sample with a fixed Hyb-FPDE mixture.
Complete example
Positive attribution values support the target class relative to the rival class.
Negative values support the rival class relative to the target class.
Scale features before using distance-based explanations when feature units differ.
FPDE expects training, validation, and explanation inputs to share the same feature space.
Run the repository example
Clone the repository and run the minimal example.