# A Python Library For Empirical Calibration

arXiv: https://arxiv.org/abs/1906.11920 · HTML: https://mlsanity.com/paper/1906.11920/

## Key facts

- Cited by 2 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 27 Jun 2019.

## Built on by (most cited first, 2 of 2)

- [balance -- a Python package for balancing biased data samples](https://mlsanity.com/paper/2307.06024/) (2023)
- [A Practical Upper Bound on Selection Bias Effects in Medical Prediction Models](https://mlsanity.com/paper/2606.00563/) (2026)

## Abstract (arXiv)

Dealing with biased data samples is a common task across many statistical fields. In survey sampling, bias often occurs due to unrepresentative samples. In causal studies with observational data, the treated versus untreated group assignment is often correlated with covariates, i.e., not random. Empirical calibration is a generic weighting method that presents a unified view on correcting or reducing the data biases for the tasks mentioned above. We provide a Python library EC to compute the empirical calibration weights. The problem is formulated as convex optimization and solved efficiently in the dual form. Compared to existing software, EC is both more efficient and robust. EC also accommodates different optimization objectives, supports weight clipping, and allows inexact calibration, which improves usability. We demonstrate its usage across various experiments with both simulated and real-world data.
