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

ditch negative zero in ftest output #501

Merged
merged 5 commits into from
Sep 29, 2022
Merged

ditch negative zero in ftest output #501

merged 5 commits into from
Sep 29, 2022

Conversation

palday
Copy link
Member

@palday palday commented Sep 29, 2022

closes #461.

I also updated some docstring tests so that they would pass. (cf. also #469)

@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2022

Codecov Report

Base: 87.08% // Head: 87.09% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (5b7defe) compared to base (7299d18).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #501      +/-   ##
==========================================
+ Coverage   87.08%   87.09%   +0.01%     
==========================================
  Files           7        7              
  Lines         929      930       +1     
==========================================
+ Hits          809      810       +1     
  Misses        120      120              
Impacted Files Coverage Δ
src/ftest.jl 100.00% <100.00%> (ø)
src/GLM.jl 50.00% <0.00%> (-16.67%) ⬇️

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.

@nalimilan
Copy link
Member

nalimilan commented Sep 29, 2022

Thanks. Just another though: maybe we should apply rounding only in show? The advantage is that we know we use 4 digits, so we can change -0.0000 to 0.0000 safely without applying an arbitrary threshold.

This wouldn't fix tests that check internal fields directly, but anyway if we only clamp small negative values to zero, we have to use isapprox with some tolerance to handle small positive values.

@palday
Copy link
Member Author

palday commented Sep 29, 2022

Can do, but mathematically this is non-adjusted R2, so should be strictly non-negative. Negative zero is just a floating point issue.

@nalimilan
Copy link
Member

Yes, I agree, but the choice of an arbitrary threshold is annoying, and it seems safer to just store whatever r2 returns to avoid hiding potential bugs in implementations.

src/ftest.jl Outdated Show resolved Hide resolved
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
@palday palday merged commit 9bec51e into master Sep 29, 2022
@palday palday deleted the pa/negzero branch September 29, 2022 17:07
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.

ftest and -0.0
3 participants