Skip to content

DOC More details about the attributes in MinMaxScaler #13029

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
Jan 30, 2019
Merged

DOC More details about the attributes in MinMaxScaler #13029

merged 1 commit into from
Jan 30, 2019

Conversation

qinhanmin2014
Copy link
Member

Help users to understand the attribute without reading the code.

@@ -210,6 +210,11 @@ class MinMaxScaler(BaseEstimator, TransformerMixin):

where min, max = feature_range.

The transformation is calculated as::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be talking about transformation of the training data? Shouldn't these formulas include the _ attributes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the goal is to help users understand the algorithm (users can easily extend it to new data)
I don't use _ attributes to keep consistent with the way we define the transformation:

The transformation is given by::
        X_std = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0))
        X_scaled = X_std * (max - min) + min
    where min, max = feature_range.``

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that is more accessible

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that is more accessible

So what's your suggestion here?

@glemaitre
Copy link
Member

glemaitre commented Jan 28, 2019

I am worried that if we start to define this for the MinMaxScaler, we should do it for the other scaler. I don't know if we should put more effort on the User Guide then such that those concepts a clearer there?

NB: I am not against the changes but I was wondering if you have any thoughts. @qinhanmin2014 did you have experiences where users were lacking this information in the docstring?

@qinhanmin2014
Copy link
Member Author

I am worried that if we start to define this for the MinMaxScaler, we should do it for the other scaler. I don't know if we should put more effort on the User Guide then such that those concepts a clearer there?

My intention here is to explain the attribute min_ and scale_. I think it'll be better to have a clear definition of all the attributes we provide.
And I guess it's not harmful to provide more (necessary) details either in the doc or in the user guide. We recently merged a similar PR for StandardScaler (#12446).

@glemaitre
Copy link
Member

OK I see. So I am fine with the changes then.

@jnothman jnothman merged commit 31cef3b into scikit-learn:master Jan 30, 2019
@qinhanmin2014 qinhanmin2014 deleted the minmaxscaler-doc branch January 30, 2019 14:58
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Jan 30, 2019
thomasjpfan pushed a commit to thomasjpfan/scikit-learn that referenced this pull request Feb 6, 2019
thomasjpfan pushed a commit to thomasjpfan/scikit-learn that referenced this pull request Feb 7, 2019
jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request Feb 19, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants