8000 DOC Give local recommendations about SimpleImputer in docstring (#23714) · scikit-learn/scikit-learn@9824d15 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9824d15

Browse files
DOC Give local recommendations about SimpleImputer in docstring (#23714)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
1 parent 8a01010 commit 9824d15

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

sklearn/impute/_base.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ def _more_tags(self):
136136

137137

138138
class SimpleImputer(_BaseImputer):
139-
"""Imputation transformer for completing missing values.
139+
"""Univariate imputer for completing missing values with simple strategies.
140+
141+
Replace missing values using a descriptive statistic (e.g. mean, median, or
142+
most frequent) along each column, or using a constant value.
140143
141144
Read more in the :ref:`User Guide <impute>`.
142145
@@ -224,13 +227,21 @@ class SimpleImputer(_BaseImputer):
224227
225228
See Also
226229
--------
227-
IterativeImputer : Multivariate imputation of missing values.
230+
IterativeImputer : Multivariate imputer that estimates values to impute for
231+
each feature with missing values from all the others.
232+
KNNImputer : Multivariate imputer that estimates missing features using
233+
nearest samples.
228234
229235
Notes
230236
-----
231237
Columns which only contained missing values at :meth:`fit` are discarded
232238
upon :meth:`transform` if strategy is not `"constant"`.
233239
240+
In a prediction context, simple imputation usually performs poorly when
241+
associated with a weak learner. However, with a powerful learner, it can
242+
lead to as good or better performance than complex imputation such as
243+
:class:`~sklearn.impute.IterativeImputer` or :class:`~sklearn.impute.KNNImputer`.
244+
234245
Examples
235246
--------
236247
>>> import numpy as np

0 commit comments

Comments
 (0)
0