Skip to main content

Microimpute

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]

Contributing

Pull requests are welcome. If you find a bug or have a feature idea, open an issue or submit a PR.

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microimpute 3.4.0
File Size Uploaded Provenance Actions
microimpute-3.4.0.tar.gz 158.6 kB With provenance Details for microimpute-3.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for microimpute 3.4.0
File Interpreter ABI Platform Actions
microimpute-3.4.0-py3-none-any.whl Python 3 none any Details for microimpute-3.4.0-py3-none-any.whl

Total release size: 289.1 kB

Release files / microimpute-3.4.0.tar.gz

Download URL microimpute-3.4.0.tar.gz
Size 158.6 kB
Tags Source
SHA-256 checksum
How to use checksums
127d57cf1540975697395408d0c8609dedf9a87e59b865d839ad6ce9d53f805a
BLAKE2b-256 checksum
How to use checksums
342e30883891e50e6d13010ca8f1245297cf1f5d673386b862f44b8af46ee52d
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 log

Release files / microimpute-3.4.0-py3-none-any.whl

Download URL microimpute-3.4.0-py3-none-any.whl
Size 130.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88e2d1dd5d80e701f2e087619f0005e0ca27d03c5e1b18dae54b2cf560469bbc
BLAKE2b-256 checksum
How to use checksums
ba4d577006e1a8a407e0ca918a55bf7f13b9a20d3a25bf89a6c65ff4798823ab
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 log

Security for microimpute 3.4.0

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.

Select from 2 files

Attestation for microimpute-3.4.0.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 log

A 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.

Release history Release notifications | RSS feed

This release

3.4.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page