-
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
Issue #474: Make default scoring rules functions rather than stored data sets #536
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. |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like quite a nice workflow for users?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
|
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.
LGTM. This seems really slick vs the old version for some reason.
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.
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_quantile
andmetrics_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 onR
3.6Further considerations:
rules_wis()
that includes all WIS rules.metrics
table #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.