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 finance panels:

from deup.domains.finance import CrossSectionalDEUP

model = CrossSectionalDEUP(horizon=20).fit(panel_df)
pred, unc = model.predict(test_df, return_uncertainty=True)

Install

pip install deup            # core (numpy + scikit-learn)
pip install "deup[gbm]"     # + LightGBM error predictor
pip install "deup[finance]" # + pandas (CrossSectionalDEUP)
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.3 (current): everything in v0.2 plus aggregation-reliability diagnostics (Findings 1–2), domain presets (CrossSectionalDEUP, TabularDEUP, VisionDEUP).

Next: thesis parity migration (P11), full benchmark suite with N-sweep (P12).

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.3.0.tar.gz (79.2 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.3.0-py3-none-any.whl (56.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for deup-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2edc6108ce71d20ae0e9564df896410948be408b923453088477f7844842aa50
MD5 c4b2081efa09df912a88ded34b9a5490
BLAKE2b-256 0f5158c7240aa449ce839ff8f5033b88bac31e949f9b3c6c76ec3541b3157345

See more details on using hashes here.

Provenance

The following attestation bundles were made for deup-0.3.0.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: deup-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 56.3 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 592f76e612875be0fc069a8364b2176ac59424d61c90d3d9c0e71a3e504932b4
MD5 e24549c7ad58a9f3fa1c108ec92af391
BLAKE2b-256 0cf609ecb2c4dc196a1d9b3869b65557262d972699ca4e3c06a93f08870d463a

See more details on using hashes here.

Provenance

The following attestation bundles were made for deup-0.3.0-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