-
Notifications
You must be signed in to change notification settings - Fork 688
[BUG] Fix issue with EncodeNormalizer(method='standard', center=False)
for scale value
#1902
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
Conversation
@@ -191,7 +191,10 @@ def test_NegativeBinomialDistributionLoss(center, transformation): | |||
) | |||
samples = loss.sample(rescaled_parameters, 1) | |||
assert torch.isclose(target.mean(), samples.mean(), atol=0.1, rtol=0.5) | |||
assert torch.isclose(target.std(), samples.std(), atol=0.1, rtol=0.5) | |||
if transformation == "log1p" and not center: | |||
assert torch.isclose(target.std(), samples.std(), atol=0.1, rtol=0.8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variance distorts when the data is not centered, as the log1p
transformation is log(1+x)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1902 +/- ##
=======================================
Coverage ? 86.25%
=======================================
Files ? 96
Lines ? 7772
Branches ? 0
=======================================
Hits ? 6704
Misses ? 1068
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Linked to this issue, the method
of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me in terms of the location directly fixed, though see above comment by @cngmid
FYI, if you have time to look at the |
sure will look into this🤞 |
Fixes #1901
This PR fixes the issue with
which was returning
scale_
asmean
ofx
instead itsstd
Temporarily backported lazywhere implementation from
scipy._lib._util.
to avoid import errors in thestatsmodels
with the latest scipy version.