Skip to content
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

[MRG] [ENH] Add sample_indices_ for SMOTE/ADASYN classes #933

Closed
wants to merge 28 commits into from
Closed

[MRG] [ENH] Add sample_indices_ for SMOTE/ADASYN classes #933

wants to merge 28 commits into from

Conversation

JurajSlivka
Copy link

Adding attribute sample_indices to SMOTE/ADASYN classes that contains tuple of samples used to generate new sample. For the samples for original dataset it is index of original sample.

Reference Issue

Fixes #772

What does this implement/fix? Explain your changes.

  • Adds a get_sample_indices() function that returns a tuple of sample indices from which the new sample was created. For the original samples of dataset then [index, 0] is returned. Implemented for SMOTE and ADASYN class.
  • Adds tests for get_sample_indices() function.

Adding attribute sample_indices to SMOTE/ADASYN classes that contains tuple of samples used to generate new sample. For the samples for original dataset it is index of original sample.
@codecov
Copy link

codecov bot commented Oct 28, 2022

Codecov Report

Base: 96.51% // Head: 96.38% // Decreases project coverage by -0.13% ⚠️

Coverage data is based on head (fc2cde9) compared to base (8a42dfc).
Patch coverage: 96.29% of modified lines in pull request are covered.

❗ Current head fc2cde9 differs from pull request most recent head 80062d9. Consider uploading reports for the commit 80062d9 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #933      +/-   ##
==========================================
- Coverage   96.51%   96.38%   -0.13%     
==========================================
  Files         103       95       -8     
  Lines        7280     6362     -918     
  Branches     1071      901     -170     
==========================================
- Hits         7026     6132     -894     
+ Misses        147      146       -1     
+ Partials      107       84      -23     
Impacted Files Coverage Δ
imblearn/over_sampling/_adasyn.py 91.66% <63.63%> (+7.05%) ⬆️
imblearn/over_sampling/_smote/base.py 98.12% <100.00%> (-0.88%) ⬇️
...ver_sampling/_smote/tests/test_borderline_smote.py 100.00% <100.00%> (ø)
imblearn/over_sampling/_smote/tests/test_smote.py 100.00% <100.00%> (ø)
imblearn/over_sampling/_smote/tests/test_smoten.py 100.00% <100.00%> (ø)
imblearn/over_sampling/tests/test_adasyn.py 100.00% <100.00%> (ø)
imblearn/utils/fixes.py 75.00% <0.00%> (-25.00%) ⬇️
imblearn/utils/tests/test_docstring.py 83.33% <0.00%> (-12.32%) ⬇️
imblearn/ensemble/_easy_ensemble.py 88.70% <0.00%> (-7.64%) ⬇️
imblearn/ensemble/_weight_boosting.py 79.83% <0.00%> (-6.78%) ⬇️
... and 66 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@JurajSlivka
Copy link
Author

@glemaitre could you please look at this failed tests? 4 of them are caused by outdated library which sends FutureWarning error and Windows test is failed because of Install error.

@JurajSlivka JurajSlivka deleted the issue772 branch February 12, 2023 14:50
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.

[ENH] Add sample_indices_ for SMOTE/ADASYN classes
1 participant