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

Refactor and remove SamplerBase class #2775

Merged
merged 16 commits into from Sep 14, 2021
Merged

Refactor and remove SamplerBase class #2775

merged 16 commits into from Sep 14, 2021

Conversation

angela97lin
Copy link
Contributor

@angela97lin angela97lin commented Sep 13, 2021

Closes #2607

Removes SamplerBase class, in favor of BaseSampler. BalancedClassificationSampler was a subclass of SamplerBase and only used as a component object of the Undersampler class, so simplified by removing the BalancedClassificationSampler class and moving the implementation to Undersampler.

@angela97lin angela97lin self-assigned this Sep 13, 2021
@codecov
Copy link

codecov bot commented Sep 13, 2021

Codecov Report

Merging #2775 (d1ce08f) into main (2719871) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2775     +/-   ##
=======================================
- Coverage   99.8%   99.8%   -0.0%     
=======================================
  Files        301     298      -3     
  Lines      27904   27595    -309     
=======================================
- Hits       27841   27527    -314     
- Misses        63      68      +5     
Impacted Files Coverage Δ
evalml/preprocessing/data_splitters/__init__.py 100.0% <ø> (ø)
...s/components/transformers/samplers/undersampler.py 100.0% <100.0%> (ø)
evalml/tests/component_tests/test_undersampler.py 100.0% <100.0%> (ø)
...s/components/transformers/samplers/base_sampler.py 89.2% <0.0%> (-10.8%) ⬇️

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 2719871...d1ce08f. Read the comment docs.

Copy link
Contributor

@chukarsten chukarsten left a comment

Choose a reason for hiding this comment

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

Just a few hypernits and an ask for an unnecessary comment cleanup! But awesome, this looks good.

@@ -42,12 +41,32 @@ def __init__(
random_seed=0,
**kwargs,
):
if sampling_ratio <= 0 or sampling_ratio > 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth getting ahead of the game and adding "raises" for these newish exceptions to the docstring?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Love it! Unfortunately, the linting packages aren't smart enough to tell that the class docstring should be connected to the init docstring but going to add this 😁

@angela97lin angela97lin merged commit a09d9f0 into main Sep 14, 2021
@angela97lin angela97lin deleted the 2607_base_sampler branch September 14, 2021 22:11
@chukarsten chukarsten mentioned this pull request Sep 15, 2021
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.

BaseSampler vs SamplerBase classes
2 participants