> ## Documentation Index
> Fetch the complete documentation index at: https://fpde-80-mintlify-8d7c1d86.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> FPDE is a Python package that explains classifier predictions with prototype-contrast feature attribution for tabular feature vectors.

Feature Prototype Direction Explainer (FPDE) is a Python package for prototype-contrast feature attribution.
It explains a classification result by comparing an input with a prototype for the target class and a prototype for a rival class.
FPDE then decomposes that contrast into one contribution per feature.

Use FPDE when you need a lightweight, post-hoc explanation method for tabular-style feature vectors and black-box classifiers that expose class probabilities.

## What you can do

* Build class-mean prototypes from training data.
* Explain one sample with Diff-FPDE, Cos-FPDE, or Hyb-FPDE.
* Explain batches while reusing fitted prototype state.
* Search Diff, Cos, and Hyb-FPDE candidate settings.
* Select `lambda_hyb` with held-out deletion and insertion validation.
* Build a Bayesian-FPDE posterior over `lambda_hyb` candidates and explain with the posterior mean.
* Compute deletion and insertion perturbation curves for an attribution vector.

## How FPDE explains a prediction

FPDE starts from a local class contrast.
The target class is usually the classifier's top predicted class.
The rival class is usually the second-highest-probability class.

FPDE compares the input against the target prototype and the rival prototype.
Positive attribution values support the target class relative to the rival class.
Negative values support the rival class relative to the target class.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Install FPDE, fit an engine, and explain your first sample.
  </Card>

  <Card title="Method overview" icon="diagram-project" href="/method-overview">
    Learn the target-versus-rival contrast behind Diff-FPDE, Cos-FPDE, and Hyb-FPDE.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference">
    Review the public functions, classes, parameters, and result objects.
  </Card>

  <Card title="Reproducibility" icon="clipboard-check" href="/reproducibility">
    Record the settings you need to reproduce FPDE experiments.
  </Card>
</CardGroup>

## Requirements

FPDE requires Python 3.12 or newer.
The package depends on NumPy and scikit-learn.

```bash theme={null}
python -m pip install fpde
```

## Project links

* [Repository](https://github.com/fpde-xai/fpde)
* [PyPI package](https://pypi.org/project/fpde/)
* [Citation metadata](https://github.com/fpde-xai/fpde/blob/main/CITATION.cff)
* [License](https://github.com/fpde-xai/fpde/blob/main/LICENSE)
