Skip to main content

Predictive multiplicity for deep learning

Project description

multiplicity

CI Black python pytorch License

Library for evaluating predictive multiplicity of deep leearning models.

Setup

pip install multiplicity

Quickstart

The library provides a method to estimate viable prediction intervals: prediction intervals that are robust to a small change in model's loss at training or evaluation time.

Import the library:

from multiplicity import torch as multiplicity

Suppose we have a trained torch binary classifier which outputs softmax probabilities:

model(x)  # 0.75

Specify to the deviation of which metric we want to be robust to, and on which dataset:

robustness_criterion = multiplicity.ZeroOneLossCriterion(train_loader)

Then, we can compute the viable prediction range for a given example x like so:

lb, pred, ub = multiplicity.viable_prediction_range(
    model=model,
    target_example=x,
    robustness_criterion=robustness_criterion,
    criterion_thresholds=epsilon,
)
# lb=0.71, pred=0.75, ub=0.88

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

multiplicity-2.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

multiplicity-2.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file multiplicity-2.1.0.tar.gz.

File metadata

  • Download URL: multiplicity-2.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.5.0-26-generic

File hashes

Hashes for multiplicity-2.1.0.tar.gz
Algorithm Hash digest
SHA256 b3187a22e3b680cf4b7821f3b25392a837e928f9ef2254a0f3353dcf43ab4a07
MD5 efeba26d8a8076fa307c02c622751c5f
BLAKE2b-256 14513629eede6abdc73a912bb1fc0d3eaad64867f7aa8a44004cbd5d0adf7dbf

See more details on using hashes here.

File details

Details for the file multiplicity-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: multiplicity-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.5.0-26-generic

File hashes

Hashes for multiplicity-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9d352eb892861ddfa07c166fd2382f62cec9077bc87c7abca4fddbcfc5ae027
MD5 dde026f608232c0590dd8ee8eecaeec2
BLAKE2b-256 f0c54c2c65d2048f59bf32a40b73e207b4aa8f03ff87760f1b8bdc27e53ea20d

See more details on using hashes here.

Supported by

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