skillfed

empirical-calibration

Package for empirical calibration

empirical-calibration v0.12 319.8K downloads/30d#7,642 on PyPI45
Permissive license Apache 2.0 Abandoned released

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-calibration

uv

uv add empirical-calibration

poetry

poetry add empirical-calibration

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Scientific/Engineering :: Mathematics

Tags

survey sampling bias correctionempirical calibration weightsobservational data weightingcausal inference covariate balancesample bias adjustmentconvex optimization weightingsurvey calibration python
survey-samplingcausal-inferencebias-correction

More Mathematics packages