Coarsened Exact Matching (CEM) is a Python library for causal inference via matching. It implements the CEM algorithm that coarsens variables to exact matching, reducing model dependence. Current version is 1.1.0, with a stable release cadence (last release Dec 2024). Requires Python 3.9-3.12.
pip install cemNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic CEM matching using default auto-coarsening.
Always capture the returned dict, e.g., `result = cem.match(...)`
Use `import cem` and `cem.match()`
Ensure no NaN values in columns used for treatment or coarsening.
Use `cem.match()` instead of `cem.cem()`.
Ensure your treatment column contains both 0 and 1 (or more groups).
Upgrade to cem >= 1.0.0 or use `cutpoints` directly.
No dependency data recorded yet.