Skip to main content

Utilities to calibrate model uncertainties and measure calibration.

Project description

Verified Uncertainty Calibration

Code for the NeurIPS 2019 (Spotlight) paper Verified Uncertainty Calibration

In our paper, we show that:

  • The calibration error of methods like Platt scaling is typically underestimated, and cannot be easily measured.
  • We propose an efficient recalibration method where the calibration error can be measured.
  • We show that we can estimate the calibration error with fewer samples (than the standard method) using an estimator from the meteorological literature.

Calibration Library

This repository contains library code to measure the calibration error of models, including confidence intervals computed by Bootstrap, and code to recalibrate models.

Start with examples/example.py which walks through how to recalibrate a model and estimate its calibration error, including confidence intervals. Ensure you're using Python 3 when running all our code:

export PYTHONPATH="."; python3 examples/example.py

Citation

If you find this useful please consider citing our paper:

@inproceedings{kumar2019calibration,
  author = {A. Kumar and P. Liang and T. Ma},
  booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
  title = {Verified Uncertainty Calibration},
  year = {2019},
}

Experiments

The experiments folder contains experiments for the paper. We have 4 sets of experiments:

  • Showing the Platt scaling is less calibrated than reported (Section 3)
  • Comparing the scaling binning calibrator with histogram binning on CIFAR-10 and ImageNet (Section 4)
  • Synthetic experiments to validate our theoretical bounds (Section 4)
  • Experiments showing the debiased estimator can estimate calibration error with fewer samples than standard estimator (Section 5) Running each experiment saves plots in the corresponding folder in saved_files

export PYTHONPATH="."

Then run the experiment code, for example: python3 experiments/scaling_binning_calibrator/compare_calibrators.py

More detailed instructions coming soon.

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

uncertainty-calibration-0.0.3.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file uncertainty-calibration-0.0.3.tar.gz.

File metadata

  • Download URL: uncertainty-calibration-0.0.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.6.8

File hashes

Hashes for uncertainty-calibration-0.0.3.tar.gz
Algorithm Hash digest
SHA256 89456f99d284161a21338fc5b69cadc28de37c1fbda38e8b76c86c4229dca9a7
MD5 ea6532fbee0fd6db83fdca8503d22c6c
BLAKE2b-256 d33f0c1befabf866ce0ddccd2c872127257ba30c69dd2ca44774a3254e66b856

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