empirical-calibration
Package for empirical calibration
What it is and what it does
Empirical calibration is a statistical weighting method that corrects bias in survey samples and observational data by reweighting observations to match target population characteristics. The package solves the calibration problem as a convex optimization task in dual form, supporting multiple objectives, weight clipping, and inexact calibration. It depends on numpy, scipy, scikit-learn, pandas, patsy, absl-py, and six to handle numerical computation and data manipulation.
The package is designed for survey sampling (where samples are unrepresentative) and causal inference (where treatment assignment correlates with covariates). However, the repository is archived and maintenance is abandoned as of May 2024, meaning no bug fixes, security updates, or compatibility work with newer Python or dependency versions will occur.
Use it for:
- Reweight survey respondents to match known population distributions when the sample is biased or non-random.
- Balance covariate distributions between treatment and control groups in observational causal studies.
- Correct for selection bias in administrative or real-world datasets where sampling was not random.
- Compute inverse-probability weights for observational studies with complex covariate imbalance.
- Apply weight clipping to avoid extreme weights that can destabilize downstream analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes empirical calibration weights to correct bias in survey samples and observational data through convex optimization, supporting weight clipping and inexact calibration.
No. The package is abandoned (archived repository, no commits since May 2024) and has high install friction with seven dependencies. While empirical calibration is a legitimate statistical technique, the lack of maintenance means no support for modern Python or dependency versions, no bug fixes, and no security updates. Use only if you have a frozen environment and cannot migrate to actively maintained alternatives.
Install
empirical-calibration on PyPI
pip
pip install empirical-calibrationuv
uv add empirical-calibrationpoetry
poetry add empirical-calibrationInstalling empirical-calibration
Before you install
High install friction due to 7 runtime dependencies (numpy, scipy, scikit-learn, pandas, patsy, absl-py, six). Repository is archived and maintenance is abandoned as of 2024-05-05, with no active development or support.
License in practice
Apache 2.0 permissive license allows commercial and private use with minimal restrictions, though the abandoned status means no ongoing legal or security updates.
Quickstart
pip install empirical-calibration
import empirical_calibration as ec
# Use ec to compute calibration weights for your biased sample data
Requires Python 3.6 or later; package is abandoned and no longer maintained.
Verify before relying
- Current compatibility with Python versions beyond 3.7 (classifiers list 3.6 and 3.7 only; package is archived)
- Whether the package works reliably with modern versions of its dependencies (numpy, scipy, scikit-learn, pandas)
- Performance or robustness claims relative to existing software mentioned in the description
Package facts
| License | Apache 2.0 (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | 7 — absl-py, numpy, pandas, patsy, scipy, six, scikit-learn |
| Maintenance | abandoned — 831 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 319,751/month — #7,642 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: empirical_calibration-0.12.tar.gz
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
fairlearnFairlearn assesses and mitigates fairness…
permissive · top 15,000 on PyPI
psmpyPsmPy implements propensity score matching for…
permissive · top 5,000 on PyPI
causallibCausallib estimates causal effects from…
permissive · top 5,000 on PyPI
causalmlCausalml estimates the causal impact of…
permissive · top 15,000 on PyPI
cemImplements Coarsened Exact Matching (CEM), a…
unclear · top 5,000 on PyPI
cvxoptcvxopt is a Python library for solving convex…
unclear · top 5,000 on PyPI
betacalFits beta calibration models to classifier…
permissive · top 15,000 on PyPI
econmlEconML estimates heterogeneous treatment…
permissive · top 15,000 on PyPI
spintSpInt calibrates spatial interaction models…
permissive · top 15,000 on PyPI
cvxpyCVXPY is a Python modeling language for…
permissive · top 5,000 on PyPI