Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@KenitoInc
Copy link
Contributor

We are having warning since we are using n_quantiles default values. Fix this by assigning a value to n_quantiles during class initialization.

Related to issue #14117

#WiMLDS
@MaggieChege
@dominicondigo

@adrinjalali
Copy link
Member

test failing :)

Copy link
Contributor

@albertcthomas albertcthomas left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM! Thanks @KenitoInc!

bc = PowerTransformer(method='box-cox')
yj = PowerTransformer(method='yeo-johnson')
qt = QuantileTransformer(output_distribution='normal', random_state=rng)
qt = QuantileTransformer(n_quantiles=500, output_distribution='normal',
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add a comment explaining that n_quantiles is set to the training set size to avoid a warning.

Copy link
Member

Choose a reason for hiding this comment

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

"Avoiding the warning" is doing the correct thing in this case. In this case, n_quantiles=500 is the number of samples in X_train (because test_size=0.5 and N_SAMPLES=1000).

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree but I would make this explicit so that someone reading the example or changing the code will know why.
Unless tests will be failing if a warning is raised?

Copy link
Contributor

Choose a reason for hiding this comment

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

@KenitoInc I am sorry if I was not clear but what I meant was more something like "n_quantiles is set to the training set size rather than the default value to avoid a warning being raised by this example"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @albertcthomas I have updated the PR

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM

@glemaitre
Copy link
Member

@thomasjpfan @albertcthomas I am fine with the comment. I let you both decide if you want to change anything.

@KenitoInc Thanks for picking this up.

@albertcthomas
Copy link
Contributor

Ok for me as well. Thanks @KenitoInc!

@rth
Copy link
Member

rth commented Jun 24, 2019

Thanks!

@rth rth changed the title Added n_quantiles=500 when initializing the class EXA Use n_quantiles=500 in plot_map_data_to_normal.py Jun 24, 2019
@rth rth merged commit f41cd1e into scikit-learn:master Jun 24, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants