Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Microimpute

PolicyEngine has archived microimpute. Microcosm builds PolicyEngine’s microdata and fits its imputation models with the microcosm-fit package. PyPI keeps the package’s releases, so pip install microimpute still works. The open issues include correctness bugs that no release fixes, such as the default QRF’s miscalibrated quantiles.

Microimpute is a Python package for imputing variables from one survey dataset onto another. It wraps five imputation methods behind a common interface so you can benchmark them on your data and pick the one that works best: impute one or multiple variables with any of the available methods, and compare their performance using quantile loss and log loss.

The package supports:

Microimputation dashboard

To visualize imputation and benchmarking results, install Node.js, run make dashboard from the root of the microimpute repository, and open http://localhost:3000.

To use the dashboard, CSV files must contain the following columns in this exact order:

The format_csv() function from microimpute.utils formats imputation and benchmarking results into the correct structure for the dashboard. It accepts outputs from various analysis functions (autoimpute results, comparison metrics, distribution comparisons) and returns a properly formatted DataFrame.