Registry / ai-ml / missingpy

missingpy

JSON →
library0.2.0pypypiunverified

MissingPy is a Python library providing tools for missing data imputation, offering an API consistent with scikit-learn. It primarily supports k-Nearest Neighbors (KNNImputer) and Random Forest-based (MissForest) imputation algorithms. The current version is 0.2.0, released in December 2018. Due to infrequent updates since its last release and limited recent activity on its GitHub repository, the library is considered to be in a maintenance state, with no active development or new releases anticipated.

ai-mldata
Install & Compatibility
Where this runs
tested against v0.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.1MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from missingpy import KNNImputer

This quickstart demonstrates how to use `MissForest` to impute missing values (represented by `np.nan`) in a NumPy array. It includes the necessary workaround for `scikit-learn` compatibility that is commonly required. Ensure categorical variables are one-hot encoded before passing them to the imputer.

import numpy as np # Workaround for scikit-learn compatibility import sklearn.neighbors._base import sys sys.modules['sklearn.neighbors.base'] = sklearn.neighbors._base from missingpy import MissForest nan = np.nan X = np.array([ [1, 2, nan], [3, 4, 3], [nan, 6, 5], [8, 8, 7] ]) imputer = MissForest(random_state=42) X_imputed = imputer.fit_transform(X) print("Original Data with NaNs:\n", X) print("Imputed Data:\n", X_imputed)
Debug
Known footguns
breakingMissingPy has severe compatibility issues with recent versions of `scikit-learn` (e.g., >=1.0) due to reliance on internal `sklearn.neighbors` modules that have been reorganized or removed. This often leads to `ImportError`.
gotchaMissingPy's `MissForest` algorithm expects numerical input. If your dataset contains categorical variables, they must be explicitly one-hot encoded (dummy encoded) before passing them to the imputer, otherwise, it will raise an error like 'could not convert string to float'.
gotchaThe `missingpy` library is no longer actively maintained. The last PyPI release was in December 2018, and the GitHub repository shows minimal activity since. This means there will likely be no official updates for newer Python versions, `scikit-learn` compatibility, or bug fixes.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
24 hits · last 30 days
googlebot
5
ahrefsbot
4
oai-searchbot
4
dotbot
3
chatgpt-user
3
script
1
bytedance
1
Resources