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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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