Repository navigation
[MRG] Dynamically set n_quantiles to min(n_samples, n_quantiles) in QuantileTransformer - #13333
Merged
Merged
Conversation
albertcthomas
force-pushed
the
n_quantiles
branch
from
February 28, 2019 15:17
b3e207b to
6e1c01f
Compare
glemaitre
requested changes
Feb 28, 2019
glemaitre
left a comment
Member
There was a problem hiding this comment.
You need an entry in what's new. If we considered it as a bug fix then we don't need a deprecation.
| transformer.transform, 10) | ||
| # check that a warning is raised is n_quantiles > n_samples | ||
| transformer = QuantileTransformer(n_quantiles=100) | ||
| assert_warns_message(UserWarning, |
Member
There was a problem hiding this comment.
Could you use pytest to catch warning instead?
| n_samples = X.shape[0] | ||
|
|
||
| if self.n_quantiles > n_samples: | ||
| self.n_quantiles = n_samples |
Member
There was a problem hiding this comment.
It should be called n_quantiles_ isn't it?
Contributor
Author
There was a problem hiding this comment.
yes indeed I just fixed it
glemaitre
self-requested a review
February 28, 2019 16:28
glemaitre
approved these changes
Feb 28, 2019
Contributor
Author
|
Thanks @glemaitre |
jnothman
reviewed
Feb 28, 2019
| n_samples = X.shape[0] | ||
|
|
||
| if self.n_quantiles > n_samples: | ||
| warnings.warn("n_quantiles (%s) is greater than the total number " |
Member
There was a problem hiding this comment.
I think this is more verbose than is helpful. "n_quantiles (%d) is being reduced to the number of samples (%d)" if you want to add another phrase explaining why, okay, but I think it's intuitively okay.
Co-Authored-By: albertcthomas <[email protected]>
albertcthomas
force-pushed
the
n_quantiles
branch
from
March 1, 2019 08:52
d105f79 to
cfb2b19
Compare
Contributor
Author
|
Thanks @jnothman |
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
…eTransformer (scikit-learn#13333)" This reverts commit 6dd1404.
xhluca
pushed a commit
to xhluca/scikit-learn
that referenced
this pull request
Apr 28, 2019
…eTransformer (scikit-learn#13333)" This reverts commit 6dd1404.
koenvandevelde
pushed a commit
to koenvandevelde/scikit-learn
that referenced
this pull request
Jul 12, 2019
davidgegiya
added a commit
to davidgegiya/agent-orchestrator
that referenced
this pull request
Nov 9, 2026
…ansformer Pin 04a5733b86bba57a48520b97b9c0a5cd325a1b9a and its regression selectors for reproducible runs. Source: scikit-learn/scikit-learn#13333
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13315
Values of
n_quantileslarger thann_sampleseither do not lead to a better approximation of the cdf estimator or to a wrong approximation. See #13315 for details.Don't know if this is considered as a bug or if this requires a deprecation cycle?