Install FPDE
Install the PyPI package and check that your environment meets the requirements.
Run the quickstart
Train a scikit-learn classifier and explain your first sample.
Explain one sample
Fit reusable prototype state and inspect a single target-versus-rival explanation.
Explain batches
Generate attribution matrices while keeping per-sample metadata.
Choose lambda_hyb
Select a Hyb-FPDE mixture weight with held-out deletion and insertion validation.
Look up APIs
Review public classes, functions, parameters, result objects, and errors.
What FPDE does
FPDE builds one class-mean prototype per class from training data. For one input, it chooses a target class and a rival class. WithFPDEEngine, the target class is the model’s highest-probability class and the rival class is the second-highest-probability class.
The output is an attribution vector with one value per feature.
Positive values support the target class.
Negative values support the rival class.
What you need
- Python 3.12 or newer
- NumPy and scikit-learn
- Training data and labels in the same feature space used by the classifier
- A fitted classifier with
predict_probaandclasses_for model-driven workflows