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

Skip to content

Commit 8a01010

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

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
@@ -91,10 +91,10 @@ class KNNImputer(_BaseImputer):
9191
9292
See Also
9393
--------
94-
SimpleImputer : Imputation transformer for completing missing values
94+
SimpleImputer : Univariate imputer for completing missing values
9595
with simple strategies.
96-
IterativeImputer : Multivariate imputer that estimates each feature
97-
from all the others.
96+
IterativeImputer : Multivariate imputer that estimates values to impute for
97+
each feature with missing values from all the others.
9898
9999
References
100100
----------

0 commit comments

Comments
 (0)
0