fpde.
The fpde.core module also aggregates the same public API for compatibility.
fpde 0.1.0.
FPDEEngine
UseFPDEEngine for repeated explanations, batch explanations, Hyb-FPDE, grid search, and validation-based lambda_hyb selection.
FPDEEngine.fit
Returns an
FPDEEngine.
engine.explain_one
(attributions, details).
The details dictionary includes target_label, rival_label, target_probability, lambda_hyb, evidence, exactness_residual, positive_score, and negative_score.
engine.explain_batch
(attribution_matrix, details).
If include_details=False, details is an empty list.
engine.explain_matrix
engine.select_lambda
lambda_hyb by held-out deletion and insertion validation.
Returns a HybFPDEValidationSelectionResult.
engine.grid_search
HybFPDEGridSearchResult.
Shared parameters
Prototype helpers
Use these functions when you want manual control over prototype state.class_mean_prototypes
(prototypes, labels).
select_prototype_pair
(positive_index, negative_index).
prepare_fpde_context
FPDEContext.
Explanation functions
Use these functions when you want direct control over prototypes and labels.diff_fpde
FPDEExplanation.
cos_fpde
FPDEExplanation.
explain_with_selected_prototypes
FPDEEngine for Hyb-FPDE.
Metrics and probability helpers
regularized_cosine
top_two_labels
(target_label, rival_label, probability_vector) for one sample.
model must implement predict_proba and expose classes_.
predict_proba_for_label
predict_proba(X) column for label.
perturbation_curves
parse_float_grid
Result objects
Common errors
For a guided version of these fixes, see Troubleshooting.