-
Notifications
You must be signed in to change notification settings - Fork 40
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
fairBS and fairRPS #211
fairBS and fairRPS #211
Conversation
Fix formula
if weights is not None: | ||
res = res.weighted(weights) | ||
res = xr.apply_ufunc(np.clip, res, 0, 1, dask="allowed") # dirty fix |
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.
Ideally this shouldn't be needed, I dont understand why without this line I get out-of-bounds results in tests
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.
any thought on this? maybe some weird edge case in my tests @raybellwaves
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.
Couple of thoughts. Does it happen on the fair_bool=True
tests? If so can move it inside a if fair:
curious is xr.apply_ufunc(np.clip, ...
faster that two where statements
a.where(a < 1, 1).where(a > 0, 0)
or is it better with dask objects
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.
I see test_rps_limits
is a new test so it may have be an issue before this PR.
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.
still I am not 100% confident with this
I think doing Nice work on the tests |
Description
add fair brier score https://www-miklip.dkrz.de/about/problems/
add as fair=False keyword into brier
Same for rps
name and cleanup each test in probabilistic (sorry for mixing two PRs into one, the purpose of tests was unclear to me so I gave all tests a docstring and refactored a bit)
Question: With
fair=True
brier_score
requires members in forecast, withbrier_score(fair=False)
it requires probabilities. Should we align this? Or at least allow also member in forecasts forbrier_score(fair=False)
and doforecast.mean('member')
internally (my favorite but not implemented yet)?Closes #162 #255
Type of change
Please delete options that are not relevant.
asv
to detect performance changes)How Has This Been Tested?
Please describe the tests that you ran to verify your changes. This could point to a cell in the updated notebooks. Or a snippet of code with accompanying figures here.
Checklist (while developing)
pytest
, if necessary.Pre-Merge Checklist (final steps)
References
https://www-miklip.dkrz.de/about/problems/