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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file uncertainty-calibration-0.0.2.tar.gz
.
File metadata
- Download URL: uncertainty-calibration-0.0.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e9abde5c2b899b3c19d0f578780a9d0f0ca1891bb136411cc809646156c55d1 |
|
MD5 | 60144a9e0a5e73f01f9dd6bed797e1d9 |
|
BLAKE2b-256 | c447e6eb5e5c2f10ca2521216c6955359e3d8936303c4e7caf473752c634c647 |