Skip to content

[MRG] EHN: split and factorize SMOTE classes #440

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 11 commits into from
Jul 27, 2018

Conversation

glemaitre
Copy link
Member

@glemaitre glemaitre commented Jul 26, 2018

Split the SMOTE class into several classes.

TODO:

  • Unit test specifically for SVMSMOTE and BorderlineSMOTE
  • Update the User Guide
  • Update the example
  • Add an entry in what's new

Related to #435

@pep8speaks
Copy link

pep8speaks commented Jul 26, 2018

Hello @glemaitre! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on July 27, 2018 at 20:17 Hours UTC

@codecov
Copy link

codecov bot commented Jul 27, 2018

Codecov Report

Merging #440 into master will increase coverage by 0.04%.
The diff coverage is 99.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #440      +/-   ##
==========================================
+ Coverage   98.71%   98.75%   +0.04%     
==========================================
  Files          70       70              
  Lines        4188     4270      +82     
==========================================
+ Hits         4134     4217      +83     
+ Misses         54       53       -1
Impacted Files Coverage Δ
imblearn/utils/estimator_checks.py 96.75% <100%> (+0.06%) ⬆️
imblearn/over_sampling/__init__.py 100% <100%> (ø) ⬆️
imblearn/over_sampling/tests/test_smote.py 100% <100%> (ø) ⬆️
imblearn/over_sampling/smote.py 94.25% <99.04%> (+2.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2fed48f...d8c1843. Read the comment docs.

@glemaitre glemaitre changed the title [WIP] EHN: split and factorize SMOTE classes [MRG] EHN: split and factorize SMOTE classes Jul 27, 2018
@glemaitre
Copy link
Member Author

@chkoar @StephanHeijl Could you have a look to this PR.
I think that this is ready to be merged but I would like to have at least a second opinion.

assert_allclose(X_resampled, X_gt, rtol=R_TOL)
assert_array_equal(y_resampled, y_gt)


@pytest.mark.filterwarnings('ignore:"kind" is deprecated in 0.4 and will be')
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like all these filter warnings require some extra text.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a regular expression. Only the beginning is useful (mainly the name of the parameter)

[1.07844561, -0.19435291], [1.44015515, -1.30621303]])
y_gt = np.array(
[0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0])
X_gt = np.array([[0.11622591, -0.0317206],
Copy link
Contributor

Choose a reason for hiding this comment

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

Not extremely important, but it might be good to pick a single format for X* arrays here; 10x2 or 20x1.

@StephanHeijl
Copy link
Contributor

StephanHeijl commented Jul 27, 2018

Just looked this over, the code was moved around properly (as evidenced by the succeeding tests), so I only found small remarks. Aside from those it looks good to me, I'll be happy to adjust the KMeans code to conform to this format.

@glemaitre glemaitre merged commit eafae67 into scikit-learn-contrib:master Jul 27, 2018
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