Microimpute
PolicyEngine has archived microimpute. Microcosm builds PolicyEngine's microdata and fits its imputation models with the
microcosm-fitpackage. PyPI keeps the package's releases, sopip install microimputestill 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, rather than defaulting to a single approach.
Methods
- Statistical Matching: distance-based matching to find similar donor observations
- Ordinary Least Squares (OLS): linear regression imputation
- Quantile Regression: models conditional quantiles instead of the conditional mean
- Quantile Regression Forests (QRF): non-parametric, tree-based quantile estimation
- Mixture Density Networks (MDN): neural network with a Gaussian mixture output
Autoimpute
The autoimpute function tunes hyperparameters, runs cross-validation across all five methods, and selects the best performer based on quantile loss (for numerical targets) or log loss (for categorical targets). It handles numerical, categorical, and boolean variables.
API
All models follow a fit() / predict() interface. The package supports sample weights to account for survey design, and validates inputs automatically. Adding a custom imputation method is straightforward since new models just need to implement the same interface.
Documentation and paper
- Documentation with examples and interactive notebooks
- Paper presenting microimpute and demonstrating it for SCF-to-CPS net worth imputation
Dashboard
Install Node.js, clone the microimpute repository and run make dashboard from its root to start the interactive dashboard in microimputation-dashboard. Open http://localhost:3000 and upload a CSV file, load one from a URL or try the sample data to explore imputation results.
Installation
pip install microimpute
For image export (PNG/JPG):
pip install microimpute[images]
License
PolicyEngine releases the code in this repository under the MIT License, and its original text and figures under CC BY 4.0 with attribution to PolicyEngine. Third-party data and materials keep their own terms. The optional matching extra installs rpy2, which its authors license under GPL-2.0-or-later. The paper notebook paper/imputing-from-scf-to-cps.ipynb imports policyengine-us and policyengine-core, which carry AGPL-3.0.
Metadata
Release files for microimpute 3.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| microimpute-3.4.1.tar.gz | 159.8 kB | With provenance | Details for microimpute-3.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| microimpute-3.4.1-py3-none-any.whl | Python 3 | none | any | Details for microimpute-3.4.1-py3-none-any.whl |
Total release size: 290.6 kB
Release files / microimpute-3.4.1.tar.gz
| Download URL | microimpute-3.4.1.tar.gz |
|---|---|
| Size | 159.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b023899d01c4e61905ca2b619a58b1f32badcbd3e6c07a9e9a0a17aea587182
|
|
BLAKE2b-256 checksum How to use checksums |
669af2902a08658b6d1f3c136459faf4793460043f46337e35dcae6514053e68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / microimpute-3.4.1-py3-none-any.whl
| Download URL | microimpute-3.4.1-py3-none-any.whl |
|---|---|
| Size | 130.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
763f39acaa34a194b9679f12149b9051e5560a942aacdbbf48f39223d76059ff
|
|
BLAKE2b-256 checksum How to use checksums |
ff8c3f99e56a75453d94433ffc97ae1ea1c7f536994d159b4600fa5272e5c169
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logSecurity for microimpute 3.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for microimpute-3.4.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.