Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Scikit learn Scikit learn EnableIterativeImputer

From Leeroopedia


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

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)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment