FPDEEngine for most workflows.
It stores prototypes, anchors, the baseline vector, and label lookup state so you can reuse them across explanations.
Explain one sample
details["target_label"] is the model’s highest-probability class.
details["rival_label"] is the second-highest-probability class.
Explain a batch
Useexplain_batch when you need both attribution rows and per-sample metadata.
explain_matrix when you only need the attribution matrix.
Select lambda_hyb
Use held-out validation data to select a fixed Hyb-FPDE mixture.
The selection score combines deletion and insertion perturbation curves.
selection.rows with your experiment results so you can inspect the score for each candidate later.
Build a Bayesian-FPDE posterior over lambda_hyb
Use select_bayesian_lambda when you want a posterior over the Hyb-FPDE mixture weight instead of a single selected value.
The posterior is built on the same held-out deletion and insertion score as select_lambda, with a Beta(alpha, beta) prior and a likelihood temperature.
lambda_hyb:
explain_batch_bayesian or explain_matrix_bayesian for many samples.
Inspect selection.sorted_rows() to see candidates from highest to lowest posterior mass.
Run grid search
Usegrid_search to compare Diff-FPDE, Cos-FPDE, and Hyb-FPDE candidate settings.
Direct prototype functions
Use lower-level functions when you want direct control over prototypes and labels.FPDEEngine.