FIX Prevent incorrect class category resampling in SMOTENC when median_std_ == 0#675
Merged
glemaitre merged 7 commits intoscikit-learn-contrib:masterfrom Jun 9, 2020
Conversation
Member
|
Could you retrigger the CIs since we solve the issue with the dependencies. |
Codecov Report
@@ Coverage Diff @@
## master #675 +/- ##
=======================================
Coverage 96.48% 96.49%
=======================================
Files 82 82
Lines 5035 5043 +8
=======================================
+ Hits 4858 4866 +8
Misses 177 177
Continue to review full report at Codecov.
|
Member
|
I added your non-regression test and I think that we are good to merge |
Member
|
@bganglia Thanks for the contribution |
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 #662
What does this implement/fix? Explain your changes.
If the median standard deviation is 0, the SMOTENC class will now store the categorical features before multiplying the 1's by the median standard deviation. This way, information about the most common categorical labels can still be used in _get_samples.
Checklist:
Example:
Output on master:
Only the last row is new. It has the category 1 in the fourth column, even though all rows from the minority class have the category 2 in the fourth column. This is incorrect.
Output on this fork:
Here, the resampled row correctly has the category 2 in the fourth column.