Skip to main content

Direct Epistemic Uncertainty Prediction (DEUP) for any scikit-learn model, with first-class time-series support.

Project description

deup

Direct Epistemic Uncertainty Prediction (DEUP) for any scikit-learn model — with first-class, leakage-correct time-series support.

PyPI CI Docs

DEUP estimates epistemic uncertainty by training a secondary error predictor on your model's out-of-sample errors — no ensembles, no Bayesian retraining, works with the model you already use. The method is due to Lahlou et al., 2023 (TMLR); this package is a maintained, installable, scikit-learn-compatible implementation of it.

Repository: https://github.com/ursinasanderink/deup · Docs: https://ursinasanderink.github.io/deup/

Quickstart

from sklearn.ensemble import RandomForestRegressor
from deup import DEUPRegressor

model = DEUPRegressor(base_model=RandomForestRegressor())
model.fit(X_train, y_train)

pred, unc = model.predict(X_test, return_uncertainty=True)

For time-series / cross-sectional data, pass a leakage-safe splitter:

from deup.splitters import PurgedWalkForward

model = DEUPRegressor(base_model=my_model, cv=PurgedWalkForward(embargo=5))

Install

pip install deup            # core (numpy + scikit-learn)
pip install "deup[gbm]"     # + LightGBM error predictor
pip install "deup[docs]"    # + MkDocs site locally

Why this exists

The only public DEUP code is a 3-year-old research repo of notebooks; no maintained pip-installable package existed until now. Major UQ libraries (torch-uncertainty, uncertainty-toolbox, MAPIE) don't implement DEUP. deup fills that gap with correct out-of-fold error construction for time-series / cross-sectional data.

On California housing (v0.1 benchmark), DEUP uncertainty ranks test errors better than ensemble disagreement or a conformal residual baseline — see BENCHMARKS.md.

Status / roadmap

v0.1 (released): DEUPRegressor, OOF collector, splitters, full loss registry (squared / Brier / pinball / rank), target transforms (log / asinh), benchmark, docs.

v0.2: DEUPClassifier / DEUPRanker, conformal intervals, aleatoric decomposition, density/GP features, aggregation-reliability diagnostics.

Citing

If you use deup, please cite both this software (see CITATION.cff) and the original DEUP paper (Lahlou et al., 2023).

License

Apache-2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deup-0.1.1.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deup-0.1.1-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file deup-0.1.1.tar.gz.

File metadata

  • Download URL: deup-0.1.1.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deup-0.1.1.tar.gz
Algorithm Hash digest
SHA256 17b363065aaab37d9e99c5b42cae5b1f5e8c7bedada15c96c31e76435936e916
MD5 24634dcb8f17ef961d0db8e09201d009
BLAKE2b-256 430bcffe6d17e4b0ab740a7376448b64c6c9b51219dbf8a6cb3a97e351061164

See more details on using hashes here.

Provenance

The following attestation bundles were made for deup-0.1.1.tar.gz:

Publisher: release.yml on ursinasanderink/deup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deup-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: deup-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deup-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60d7f9dc84b84aff5552f226e0eae26bde8e03c05426ef97a0d8246ff9979ae6
MD5 b4b6fb3703ca7e18019a791ebaa573ad
BLAKE2b-256 6a7dac7cc023c9f5bbdedd9de8f9afa814c53a9da0f6d8939895b4ce44bbdf93

See more details on using hashes here.

Provenance

The following attestation bundles were made for deup-0.1.1-py3-none-any.whl:

Publisher: release.yml on ursinasanderink/deup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page