Registry / ai-ml / miceforest

miceforest

JSON →
library6.0.5pypypi✓ verified 84d ago

Fast multiple imputation using Random Forests and LightGBM, implementing Multiple Imputation by Chained Equations (MICE). Current version: 6.0.5, release cadence: irregular major versions with breaking changes.

pip install miceforest
INSTALL
IMPORT
SIG · MICEFOREST
M
miceforest
ai-mlpythonv6.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

ImputationKernel
from miceforest import ImputationKernel
from miceforest import MultipleImputedKernel
renamed in v5.0.0
ImputedData
from miceforest import ImputedData
from miceforest import ImputedDataSet
renamed in v5.0.0

Basic imputation using the main class.

import miceforest as mf from sklearn.datasets import load_iris import pandas as pd import numpy as np iris = load_iris() df = pd.DataFrame(iris.data, columns=iris.feature_names) df.iloc[:20, 0] = np.nan kernel = mf.ImputationKernel(dataset=df, datasets=1, save_all_iterations=True, random_state=1) kernel.mice(1) completed = kernel.complete_data() print(completed.isnull().sum())
Debug
Known issues
breakingIn v6.0.0, native numpy array input was removed. Only pandas DataFrames are accepted.
fix
Pass a pandas DataFrame instead of a numpy array.
affects: >=6.0.0
deprecatedMeanMatchScheme classes from v5.x are replaced by string parameters 'mean_match_strategy' and 'mean_match_candidates' in v6.0.0.
fix
Use e.g., kernel = ImputationKernel(..., mean_match_strategy='shap', mean_match_candidates=10)
affects: >=6.0.0
breakingIn v5.0.0, class names were changed: 'ImputationKernel' is now the main class, and 'ImputedData' replaces 'ImputedDataSet'. Old names cause ImportError.
fix
Use 'ImputationKernel' and 'ImputedData' from miceforest.
affects: >=5.0.0
gotchaWhen saving/loading kernels, use standard pickle or joblib, but ensure you use '__getstate__' and '__setstate__' overrides. In v6.0.0, modernized saving may break older pickles.
fix
If loading a kernel saved with v5.x, re-run imputation on the original data instead of loading.
affects: >=6.0.0
Errors
Common errors & fixes
ImportError: cannot import name 'ImputedDataSet' from 'miceforest'
Class renamed in v5.0.0.
fix
Use 'ImputedData' instead: from miceforest import ImputedData
TypeError: ImputationKernel.__init__() got an unexpected keyword argument 'mean_match_subset'
Parameter removed in v6.0.0.
fix
Use 'data_subset' parameter instead, or adjust your code to v6.x API.
Upgrade
Version history
6.0.5latest on PyPI · released Oct 27, 2025
Audit
Dependencies
lightgbmrequiredrequired for model training
pandasrequireddata manipulation
numpyrequiredarray operations
Agent activity
3 hits · last 30 days
node
2
Meta
1
Resources
miceforest — pip install miceforest · libregistry