# Changelog

This changelog is generated automatically from [GitHub Releases](https://github.com/goergen95/seapig/releases).


# seapig v0.2.0

*2026-05-21* · [GitHub](https://github.com/goergen95/seapig/releases/tag/v0.2.0)

seapig v0.2.0


## Features

- add multi-metric support to RiskCoverageMetric and allow get_curve to return multiple curves ([\#157](https://github.com/goergen95/seapig/issues/157)).
- expose knn_search method to return distances and indices ([\#143](https://github.com/goergen95/seapig/issues/143)).
- rename kpn to offset and apply mean padding ([\#140](https://github.com/goergen95/seapig/issues/140)).


## Bug fixes

- revert risk-coverage ordering to correct behavior ([\#157](https://github.com/goergen95/seapig/issues/157)).


## Refactor & Performance

- refactor: switch to FAISS-based HNSW index in place of nmslib ([\#142](https://github.com/goergen95/seapig/issues/142)).


## Documentation

- switch to "uncertainty" vocabulary (replacing "confidence") to better reflect intent ([\#158](https://github.com/goergen95/seapig/issues/158)).
- add conda-forge references and render/readme improvements ([\#159](https://github.com/goergen95/seapig/issues/159)).


## Tests & typing

- migration to use ty for typing instead of mypy ([\#150](https://github.com/goergen95/seapig/issues/150)).
- many new/improved tests covering RiskCoverageMetric, PCA/TensorPCA, logits, and L2 distance behavior to increase coverage to \>99% ([\#148](https://github.com/goergen95/seapig/issues/148)).


## CI / Build / Chores

- multiple CI/test workflow updates and codecov fixes


## Notes / Upgrade guidance

- Potential breaking change: indices serialzed to disk with version 0.1.0 are no longer supported and will result in errors.
- This release collects numerous internal improvements (tests, typing, docs) in addition to notable API and backend changes.


# seapig - Initial Zenodo Release

*2026-05-03* · [GitHub](https://github.com/goergen95/seapig/releases/tag/v0.1.0-zenodo)

Initial Release for Zenodo. See the original [release notes](https://github.com/goergen95/seapig/releases/tag/v0.1.0).


# seapig v0.1.0 - Initial Release

*2026-05-03* · [GitHub](https://github.com/goergen95/seapig/releases/tag/v0.1.0)

A lightweight library for confidence‑based selective inference for deep models. seapig provides small, composable confidence scores operating on model embeddings (or logits), calibration utilities, and a PyTorch Lightning task + torchmetrics wrapper to evaluate selective systems.


## Highlights

- Fast, interpretable confidence scores based on latent representations and logits.
- Calibration on an independent validation set to fix target coverage levels.
- Select/abstain decision utilities that produce per-sample scores and binary selections.
- Seamless integration with PyTorch Lightning via [SelectiveInferenceTask](reference/SelectiveInferenceTask.html#seapig.SelectiveInferenceTask) and torchmetrics compatibility.
- Small, dependency‑scoped core with optional extras for recommended features, docs, and development.


## Main features

- Score fitting APIs:
  - Fit from pre-computed embeddings or extract embeddings on the fly from models/loaders.
  - Calibration via empirical quantiles (`set_threshold(q=...)`).
- Built-in scores:
  - distance-based: [EuclideanScore](reference/scores.EuclideanScore.html#seapig.scores.EuclideanScore), [CosineScore](reference/scores.CosineScore.html#seapig.scores.CosineScore), [MahalanobisScore](reference/scores.MahalanobisScore.html#seapig.scores.MahalanobisScore)
  - logit-based: [EnergyScore](reference/scores.EnergyScore.html#seapig.scores.EnergyScore), [EntropyScore](reference/scores.EntropyScore.html#seapig.scores.EntropyScore), [LogitScore](reference/scores.LogitScore.html#seapig.scores.LogitScore), [MarginScore](reference/scores.MarginScore.html#seapig.scores.MarginScore), [SoftmaxScore](reference/scores.SoftmaxScore.html#seapig.scores.SoftmaxScore)
  - reconstruction-based: [PCAScore](reference/scores.PCAScore.html#seapig.scores.PCAScore)
  - PyOD-based: [PyODScore](reference/scores.PyODScore.html#seapig.scores.PyODScore)
  - Other: [RandomScore](reference/scores.RandomScore.html#seapig.scores.RandomScore)
- [SelectiveInferenceTask](reference/SelectiveInferenceTask.html#seapig.SelectiveInferenceTask): evaluate and predict with Lightning models while applying selective inference
- [SelectiveMetric](reference/SelectiveMetric.html#seapig.SelectiveMetric): wraps any torchmetris `Metric` and `MetricCollection` to reporting metrics for full/selected/rejected subsets.
- Utilities: progress-control, logging adapter, lightweight helper functions.


## Quick install

- PyPI: pip install seapig
- Latest: pip install git+https://github.com/goergen95/seapig.git
- Extras: seapig\[suggested\], seapig\[dev\], seapig\[docs\]


## Docs & examples

- Getting started, API reference and tutorials: [www.seapig.dev](www.seapig.dev)


## Tests, quality & license

- Tests included (pytest) and type hints present (py.typed).
- CI and coverage badges maintained in repo.
- License: MIT (see LICENSE)
- Code of conduct: .github/CODE_OF_CONDUCT


## Citation

- CITATION.cff included for academic use.


## Contact / contribution

- Contributions welcome -- follow the repository's contributing guidelines and run make check (formatting, linting, tests) before submitting PRs.
