8000 DOC Give local recommendations about IterativeImputer in docstrings (… · scikit-learn/scikit-learn@67044ce · GitHub
[go: up one dir, main page]

Skip to content

Commit 67044ce

Browse files
DOC Give local recommendations about IterativeImputer in docstrings (#23701)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
1 parent 7675a6f commit 67044ce

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

sklearn/impute/_iterative.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ class IterativeImputer(_BaseImputer):
183183
184184
See Also
185185
--------
186-
SimpleImputer : Univariate imputation of missing values.
186+
SimpleImputer : Univariate imputer for completing missing values
187+
with simple strategies.
188+
KNNImputer : Multivariate imputer that estimates missing features using
189+
nearest samples.
187190
188191
Notes
189192
-----
@@ -194,6 +197,16 @@ class IterativeImputer(_BaseImputer):
194197
Features which contain all missing values at :meth:`fit` are discarded upon
195198
:meth:`transform`.
196199
200+
Using defaults, the imputer scales in :math:`\\mathcal{O}(knp^3\\min(n,p))`
201+
where :math:`k` = `max_iter`, :math:`n` the number of samples and
202+
:math:`p` the number of features. It thus becomes prohibitively costly when
203+
the number of features increases. Setting
204+
`n_nearest_features << n_features`, `skip_complete=True` or increasing `tol`
205+
can help to reduce its computational cost.
206+
207+
Depending on the nature of missing values, simple imputers can be
208+
preferable in a prediction context.
209+
197210
References
198211
----------
199212
.. [1] `Stef van Buuren, Karin Groothuis-Oudshoorn (2011). "mice:

sklearn/impute/_knn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ class KNNImputer(_BaseImputer):
9090
9191
See Also
9292
--------
93-
SimpleImputer : Imputation transformer for completing missing values
93+
SimpleImputer : Univariate imputer for completing missing values
9494
with simple strategies.
95-
IterativeImputer : Multivariate imputer that estimates each feature
96-
from all the others.
95+
IterativeImputer : Multivariate imputer that estimates values to impute for
96+
each feature with missing values from all the others.
9797
9898
References
9999
----------

0 commit comments

Comments
 (0)
0