-
Notifications
You must be signed in to change notification settings - Fork 21
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
908: Flexible model column #915
Conversation
R-CMD-check for v4.0 fails for unrelated reasons, reported at mitchelloharawild/distributional#128 |
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 like compare alot and more generally like this change.
See suggestion for having "model" as a soft requirement and so using it as a default with appropriate warnings.
Does this change mean that all current forecast_units
need to be updated to include "model"?
We also might want to solicit some user feedback here. |
Don't they already? > get_forecast_unit(score(example_sample_continuous))
[1] "location" "location_name" "target_end_date" "target_type"
[5] "forecast_date" "model" "horizon" |
isn't that because when it was saved |
The answer to my question is no we had no special handling for scoringutils/R/convenience-functions.R Line 276 in 2c363c8
|
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.
Nice, thanks a lot!
My intuition is we might want to set "model" as the default for compare
(or by
, where appropriate) and just have an informative error if you don't have a "model" column available.
That would make things simple for everyone who has a model column and everyone else has to specify the argument anyway.
I don't have a very strong preference though. What do you think?
+1 for this option |
@sbfnk what do you think? Also I'm happy to do the leg-work of updating the PR if you prefer |
So just to check we're all in agreement we want to have summarise_scores(scores) ## summarise by model, error if column not present (1)
summarise_scores(scores, by = NULL) ## summarise across everything (2)
summarise_scores(scores, by = "target_type") ## summarise by target type (3)
summarise_scores(scores, by = c("model", "target_type")) ## summarise by model and target type (4) I'd find a |
I think 2 as the default is nice if we think more users will just want to summarise a single model than will be annoyed by the breaking change of going from model as default to not. I don't really have a strong view either way and we can always change this default latter so I don't see it as absolutely crucial to be 💯 on the right choice. |
I think the following should error:
It currently error as well, but we're not catching it correctly. In
to
and add e.g. the following test:
(EDIT: Just did that in #919) Other than that I'd suggest to set/keep the following defaults:
for |
Co-authored-by: Nikos Bosse <[email protected]>
* use neg_log_score * update docs, revert previous change * update docs
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.
Nice, this looks great!
I added a suggestion to correct a typo. Other than that only one minor bit:
get_pairwise_comparisons()
has currently a default by = NULL
add_relative_skill()
has a default by = character(0)
- that should probably be changed to by = NULL
Co-authored-by: Nikos Bosse <[email protected]>
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.
Nice!
This change was introduced in epiforecasts/scoringutils#915 and subsequently broke our tests.
* remove `model` parameter from scoringutils call This change was introduced in epiforecasts/scoringutils#915 and subsequently broke our tests. * hide warnings from tests A whole bunch of new warnings started popping up because scoringutils was trying to take the mean of character columns. Wrapping everything in `suppressWarnings()` helps. * okay linter
Description
This PR closes #908. It also closes #914.
It removes all hard coding of the model column, which introduces breaking changes both in
summarise_scores()
andget_pairwise_comparison()
as discussed in #908 (comment)The change in
summarise_scores()
could be made unbroken by setting the default forby
back toby = "model"
, perhaps for a transition period.In
get_pairwise_comparison()
I realised this change by splitting the existingby
argument intoby
andcompare
arguments, rather than (as previously) interpreting the first vector element to be special if equal "model" or otherwise not. This means that this can now make pairwise comparisons amongst everything but also that it breaks existing code (which could be mitigated by a defaultcompare = "model"
as above).Checklist
lintr::lint_package()
to check for style issues introduced by my changes.