10000 DOC Give local recommendations about SimpleImputer in docstring by aperezlebel · Pull Request #23714 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC Give local recommendations about SimpleImputer in docstring #23714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions sklearn/impute/_base.py
39C7
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ def _more_tags(self):


class SimpleImputer(_BaseImputer):
"""Imputation transformer for completing missing values.
"""Univariate imputer for completing missing values with simple strategies.

Replace missing values using a descriptive statistic (e.g. mean, median, or
most frequent) along each column, or using a constant value.

Read more in the :ref:`User Guide <impute>`.

Expand Down Expand Up @@ -218,13 +221,21 @@ class SimpleImputer(_BaseImputer):

See Also
--------
IterativeImputer : Multivariate imputation of missing values.
IterativeImputer : Multivariate imputer that estimates values to impute for
each feature with missing values from all the others.
KNNImputer : Multivariate imputer that estimates missing features using
nearest samples.

Notes
-----
Columns which only contained missing values at :meth:`fit` are discarded
upon :meth:`transform` if strategy is not `"constant"`.

In a prediction context, simple imputation usually performs poorly when
associated with a weak learner. However, with a powerful learner, it can
lead to as good or better performance than complex imputation such as
:class:`~sklearn.impute.IterativeImputer` or :class:`~sklearn.impute.KNNImputer`.

Examples
--------
>>> import numpy as np
Expand Down
0