Implementation:Scikit learn Scikit learn EnableIterativeImputer
| Knowledge Sources | |
|---|---|
| Domains | Machine Learning, Data Preprocessing |
| Last Updated | 2026-02-08 15:00 GMT |
Overview
Concrete tool for enabling the experimental IterativeImputer in scikit-learn's impute module.
Description
Importing this module dynamically sets IterativeImputer as an attribute of the sklearn.impute module. The IterativeImputer is an experimental estimator that models each feature with missing values as a function of other features and uses that estimate for imputation, performing multiple rounds of imputation.
Usage
Import this module before importing IterativeImputer from sklearn.impute. This is required because the estimator is experimental and its API and results may change without deprecation cycles.
Code Reference
Source Location
- Repository: scikit-learn
- File: sklearn/experimental/enable_iterative_imputer.py
Signature
# Module-level side effects:
from sklearn.impute._iterative import IterativeImputer
setattr(impute, "IterativeImputer", IterativeImputer)
Import
from sklearn.experimental import enable_iterative_imputer # noqa
from sklearn.impute import IterativeImputer
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | N/A | N/A | This is a side-effect module; importing it enables the experimental IterativeImputer |
Outputs
| Name | Type | Description |
|---|---|---|
| IterativeImputer | class | Experimental iterative imputation estimator added to sklearn.impute |
Usage Examples
Basic Usage
import numpy as np
from sklearn.experimental import enable_iterative_imputer # noqa
from sklearn.impute import IterativeImputer
X = np.array([[1, 2], [np.nan, 3], [7, 6]])
imp = IterativeImputer(max_iter=10, random_state=0)
X_imputed = imp.fit_transform(X)
print(X_imputed)