JuliaAI / Imbalance.jl

A Julia toolbox with resampling methods to correct for class imbalance.
https://juliaai.github.io/Imbalance.jl/dev/
MIT License
28 stars 1 forks source link

Introduce Undersampling Methods #56

Closed EssamWisam closed 1 year ago

EssamWisam commented 1 year ago

This PR introduces four undersampling methods to the package. This includes:

@ablaom could you please review the code introduced here and recommend further changes accordingly.

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 96.63% and project coverage change: +2.76% :tada:

Comparison is base (d473dd5) 92.95% compared to head (6d63642) 95.71%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #56 +/- ## ========================================== + Coverage 92.95% 95.71% +2.76% ========================================== Files 24 36 +12 Lines 511 724 +213 ========================================== + Hits 475 693 +218 + Misses 36 31 -5 ``` | [Files Changed](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI) | Coverage Δ | | |---|---|---| | [src/common/errors.jl](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI#diff-c3JjL2NvbW1vbi9lcnJvcnMuamw=) | `100.00% <ø> (ø)` | | | [src/random\_oversample/random\_oversample.jl](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI#diff-c3JjL3JhbmRvbV9vdmVyc2FtcGxlL3JhbmRvbV9vdmVyc2FtcGxlLmps) | `100.00% <ø> (ø)` | | | [src/rose/rose.jl](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI#diff-c3JjL3Jvc2Uvcm9zZS5qbA==) | `100.00% <ø> (ø)` | | | [src/smote/smote.jl](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI#diff-c3JjL3Ntb3RlL3Ntb3RlLmps) | `100.00% <ø> (ø)` | | | [src/smoten/smoten.jl](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI#diff-c3JjL3Ntb3Rlbi9zbW90ZW4uamw=) | `100.00% <ø> (ø)` | | | [src/smotenc/interface\_mlj.jl](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI#diff-c3JjL3Ntb3RlbmMvaW50ZXJmYWNlX21sai5qbA==) | `78.57% <ø> (+14.28%)` | :arrow_up: | | [src/smotenc/smotenc.jl](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI#diff-c3JjL3Ntb3RlbmMvc21vdGVuYy5qbA==) | `100.00% <ø> (+1.81%)` | :arrow_up: | | [src/cluster\_undersample/interface\_mlj.jl](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI#diff-c3JjL2NsdXN0ZXJfdW5kZXJzYW1wbGUvaW50ZXJmYWNlX21sai5qbA==) | `80.00% <80.00%> (ø)` | | | [src/enn\_undersample/interface\_mlj.jl](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI#diff-c3JjL2Vubl91bmRlcnNhbXBsZS9pbnRlcmZhY2VfbWxqLmps) | `80.00% <80.00%> (ø)` | | | [src/random\_undersample/interface\_mlj.jl](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI#diff-c3JjL3JhbmRvbV91bmRlcnNhbXBsZS9pbnRlcmZhY2VfbWxqLmps) | `80.00% <80.00%> (ø)` | | | ... and [15 more](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI) | | ... and [6 files with indirect coverage changes](https://app.codecov.io/gh/JuliaAI/Imbalance.jl/pull/56/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaAI)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

EssamWisam commented 1 year ago

@ablaom I appreciate the r thorough code review. Invaluable feedback as always. Ready to merge this, once you look at my responses to some of the unresolved comments (you can look at resolved ones too).

ablaom commented 1 year ago

@EssamWisam I guess you notice Documenter is failing.

EssamWisam commented 1 year ago

@EssamWisam I guess you notice Documenter is failing.

@ablaom, yes, I do. It's also failing on dev, although it builds locally perfectly. I remember trying to fix it on dev but was nontrivial so I decided to merge first then look more into it.