Skip to content

DOC Ensures MaxAbsScaler passes numpydoc validation #20455

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 1 commit into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
"MDS",
"MLPClassifier",
"MLPRegressor",
"MaxAbsScaler",
"MeanShift",
"MinCovDet",
"MiniBatchDictionaryLearning",
Expand Down
30 changes: 15 additions & 15 deletions sklearn/preprocessing/_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,19 @@ class MaxAbsScaler(TransformerMixin, BaseEstimator):
The number of samples processed by the estimator. Will be reset on
new calls to fit, but increments across ``partial_fit`` calls.

See Also
--------
maxabs_scale : Equivalent function without the estimator API.

Notes
-----
NaNs are treated as missing values: disregarded in fit, and maintained in
transform.

For a comparison of the different scalers, transformers, and normalizers,
see :ref:`examples/preprocessing/plot_all_scaling.py
<sphx_glr_auto_examples_preprocessing_plot_all_scaling.py>`.

Examples
--------
>>> from sklearn.preprocessing import MaxAbsScaler
Expand All @@ -1085,19 +1098,6 @@ class MaxAbsScaler(TransformerMixin, BaseEstimator):
array([[ 0.5, -1. , 1. ],
[ 1. , 0. , 0. ],
[ 0. , 1. , -0.5]])

See Also
--------
maxabs_scale : Equivalent function without the estimator API.

Notes
-----
NaNs are treated as missing values: disregarded in fit, and maintained in
transform.

For a comparison of the different scalers, transformers, and normalizers,
see :ref:`examples/preprocessing/plot_all_scaling.py
<sphx_glr_auto_examples_preprocessing_plot_all_scaling.py>`.
"""

def __init__(self, *, copy=True):
Expand Down Expand Up @@ -1186,7 +1186,7 @@ def partial_fit(self, X, y=None):
return self

def transform(self, X):
"""Scale the data
"""Scale the data.

Parameters
----------
Expand Down Expand Up @@ -1216,7 +1216,7 @@ def transform(self, X):
return X

def inverse_transform(self, X):
"""Scale back the data to the original representation
"""Scale back the data to the original representation.

Parameters
----------
Expand Down