๐ balance v0.20.0 is out!
What is balance?โ
balance is a Python package (from Meta) for dealing with biased samples when estimating population-level quantities. It supports common survey-weighting workflows (e.g., IPW, CBPS, rake, poststratify), diagnostics, and CLI-based pipelines.
What's new since 0.15.0 -> 0.20.0?โ
Highlights: balance now offers a reusable, sklearn-style fit/predict workflow for survey weighting: fit a weighting model once on one sample-and-target pair, then apply it to a different (e.g., larger or later-arriving) cohort with a single call. Under the hood, this is supported by a substantial architectural refactor โ Sample is now a thin facade over two new classes (SampleFrame for data + column-role metadata, BalanceFrame for adjustment orchestration), all while keeping the existing Sample API fully backward compatible.
Around that core change, this release line also brings stronger diagnostics (confidence intervals for the bias the weights manage to remove from an outcome, the r_indicator representativeness statistic, comparative ASCII plots for LLM/CLI workflows), formula support in places that previously only accepted variable lists, pandas 3.x compatibility, and a number of validation/robustness improvements.
