Skip to main content

Evaluate predictive multiplicity

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.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: multiplicity-2.0.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-25-generic

File hashes

Hashes for multiplicity-2.0.0.tar.gz
Algorithm Hash digest
SHA256 fb2b6b95584f12e6a8e2dae3a0a0fb40c23b4e3f241b436ae12a7a2dddf3daac
MD5 fb1e539832ddecaf112b632e146fd7ae
BLAKE2b-256 7d39148d53655058e9fb365764ed7d21557043aa5621b02c10f66d7d767cc3f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: multiplicity-2.0.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-25-generic

File hashes

Hashes for multiplicity-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 049fd508d0a68a63dddc3e465060e4617036b8ca956969559988d3aaf8aa1667
MD5 d2a589c81c464b31972a22d1f570f4ed
BLAKE2b-256 e72670a3553774d428ea6531801e421bbd1ae4d769903b2950be5d6c7d3672e3

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