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

Make GaussianNormalizer distribution names consistent with scipy #722

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

fealho
Copy link
Member

@fealho fealho commented Oct 17, 2023

Resolve #656.

@fealho fealho requested a review from a team as a code owner October 17, 2023 14:56
@fealho fealho requested review from rwedge and removed request for a team October 17, 2023 14:56
@codecov-commenter
Copy link

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (1502ebd) 100.00% compared to head (1ac0a8f) 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #722   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1805      1808    +3     
=========================================
+ Hits          1805      1808    +3     
Files Coverage Δ
rdt/transformers/numerical.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

rdt/transformers/numerical.py Outdated Show resolved Hide resolved
Comment on lines 296 to 298
'gaussian': univariate.GaussianUnivariate,
'student_t': univariate.StudentTUnivariate,
'truncated_gaussian': univariate.TruncatedGaussian,
Copy link
Contributor

Choose a reason for hiding this comment

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

if in the init we replaced the deprecated distribution string with the new one before calling this method we could remove the deprecated mappings from this dictionary

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good suggestion, thanks.

Copy link
Contributor

@rwedge rwedge left a comment

Choose a reason for hiding this comment

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

Looks good, one more suggestion

@@ -311,6 +316,15 @@ def __init__(self, model_missing_values=None, learn_rounding_scheme=False,

self._distributions = self._get_distributions()
if isinstance(distribution, str):
if distribution in {'gaussian', 'student_t', 'truncated_gaussian'}:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if distribution in {'gaussian', 'student_t', 'truncated_gaussian'}:
if distribution in self._DEPRECATED_DISTRIBUTIONS_MAPPING:

@fealho fealho merged commit 0b30786 into main Oct 19, 2023
45 checks passed
@fealho fealho deleted the issue-656-gaussian-normalizer branch October 19, 2023 15:14
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.

The GaussianNormalizer should accept distribution names that are consistent with scipy
4 participants