Prerequisites
- Python 3.12 or newer
fpde- A classifier that exposes
predict_probaandclasses_
1
Install FPDE
Install the stable package from PyPI.
2
Train a classifier
Train the model on the same feature space you will explain.
3
Fit FPDE
Fit reusable class-mean prototypes from the training data.
4
Explain one sample
Compute a Hyb-FPDE explanation with a fixed
lambda_hyb.Complete example
Interpret the output
details["target_label"] is the model’s highest-probability class.
details["rival_label"] is the second-highest-probability class.
details["evidence"] is the target-versus-rival contrast decomposed by FPDE.
Positive attribution values support the target class.
Negative attribution values support the rival class.
Next steps
- Use Explain one sample for a slower walkthrough of the result fields.
- Use Explain batches when you need an attribution matrix.
- Use Select lambda_hyb to choose a fixed Hyb-FPDE mixture with validation data.