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 a viable prediction range ---the minimum and maximum possible predictions--- within the Rashomon set ---a set of models that have epsilon-similar loss on some reference dataset.

import multiplicity

# Train binary classifier in torch.
x = ...
train_loader = ...
model = ...
model(x)  # e.g., 0.75

# Specify how similar is the loss for models in the Rashomon set.
epsilon = 0.01

# Specify the loss function that defines the Rashomon set.
stopping_criterion = multiplicity.ZeroOneLossStoppingCriterion(train_loader)

# Compute viable prediction range.
lb, pred, ub = multiplicity.binary_viable_prediction_range(
    model=model,
    target_example=x,
    stopping_criterion=stopping_criterion,
    criterion_thresholds=epsilon,
)
# e.g., 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-0.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

multiplicity-0.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for multiplicity-0.0.1.tar.gz
Algorithm Hash digest
SHA256 804d613c101382caf3a628cea02b029142b3e693e4bf9ee65a479670e02dee7c
MD5 f22176f5f830605752d6a3787fb018c2
BLAKE2b-256 1db9f11d3f43c54c5705790e8b6a5d95815c8f92dfad6f96a1ccc20c45d847f9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for multiplicity-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17b4cd27cdacb867f1048d98210db6b4eedb7d5d789f1e749015c2255b050559
MD5 6a4960f90e9d3b9ad8ccf2e5f31eb629
BLAKE2b-256 591721b3fea700c5c2a2d3f1239df3331694218daf3f1e5d6d2d822a83debb2e

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