Issue #474: Make default scoring rules functions rather than stored data sets#536
Issue #474: Make default scoring rules functions rather than stored data sets#536nikosbosse merged 20 commits intodevelopfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #536 +/- ##
===========================================
+ Coverage 82.50% 83.73% +1.23%
===========================================
Files 20 21 +1
Lines 1680 1722 +42
===========================================
+ Hits 1386 1442 +56
+ Misses 294 280 -14 ☔ View full report in Codecov by Sentry. |
Yes agree. We should do this in its own PR though so that we are sure we have the documentation in place to replace it.
Yes this is a nice idea and feels like its own issue. |
seabbs
left a comment
There was a problem hiding this comment.
This looks all good in the main. I have a slight query about the workflow with select_rules and it being internal vs external. See the specific comments.
| ) | ||
|
|
||
| expect_equal( | ||
| names(scoringutils:::select_rules(rules_point(), select = "ape")), |
There was a problem hiding this comment.
this seems like quite a nice workflow for users?
There was a problem hiding this comment.
but they can just do rules_point(select = "ape") instead, which is more concise.
I can see a use case once you start combining several lists, e.g. select_rules(c(a(), b()), select = c("c", "d").
There was a problem hiding this comment.
I can see a use case once you start combining several lists,
This would be the argument and the push back on it being more concise is that yes that is true but then each function is doing multiple things which can confuse users. I don't have an extremely strong opinion but think if should be exported.
|
Latest updates:
|
seabbs
left a comment
There was a problem hiding this comment.
LGTM. This seems really slick vs the old version for some reason.
seabbs
left a comment
There was a problem hiding this comment.
LGTM. This seems really slick vs the old version for some reason.
|
Thanks a lot for reviewing! |
Description
This PR fixes #474.
It
metrics_point,metrics_binary,metrics_quantileandmetrics_sample) with functions that return a list with functions used as default scoring rules (rules_point(),rules_binary(),rules_quantile()andrules_sample())select_rules()to implement basic functionality to select or exclude functions from the default list in a call torules_*()\(...)withfunction(...)to make sure everything can be run onR3.6Further considerations:
rules_wis()that includes all WIS rules.metricstable #415 we discuss additional ways to document default scoring rules.metrics, which is a data.table of explanations. I think we should ultimately get rid of thisprint()method for the scoring rules with further explanations. I'm not convinced anymore we really need this. The documentation forrules_*()links to the documentation for the additional functions, which should have all the explanations the user needs. In addition, users should be able to find everything in the vignettes. Are we happy with this? If so I suggest deleting the storedmetrics()object.print()method that simply adds a sentence "the following scores will be computed: 'names of scores'" before printing the list. This could be nice, but maybe not necessaryChecklist
lintr::lint_package()to check for style issues introduced by my changes.