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

Uploaded Source

File details

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

File metadata

  • Download URL: uncertainty-calibration-0.0.4.tar.gz
  • Upload date:
  • Size: 7.7 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.4.tar.gz
Algorithm Hash digest
SHA256 2cc605b5f8ee270282545a8d9d5e04528324778e9cf98721cfd0a886d0e3a1a8
MD5 2a14cf9dc1fc7cee510f84378d88efc4
BLAKE2b-256 b9958c1129d59dac724f2147b430f7a4cdc1487dcd1d28a1f24167c936399979

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