-
Notifications
You must be signed in to change notification settings - Fork 19
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues 520 and 484: expose function to get names of scores used in score()
#588
Conversation
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. See note about correlation metric arg. We need to very clearly and repeatedly document what a scoring rule is and what a score is in order to avoid confusing people.
@@ -21,7 +21,7 @@ | |||
correlation <- function(scores, | |||
metrics = NULL, | |||
digits = NULL) { | |||
metrics <- get_metrics(scores) | |||
metrics <- get_score_names(scores) |
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.
why is metrics an argument if it immediately gets overwritten? Shouldn't this (i.e. get_score_names be the default arg for metrics instead).
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.
also this arg needs renaming (already an issue to address this?) but not as part of 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.
Excellent point. It might be mentioned somewhere, but I'll make it a separate issue (#589) so it doesn't get buried somewhere.
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. See note about correlation metric arg. We need to very clearly and repeatedly document what a scoring rule is and what a score is in order to avoid confusing people.
Description
This PR partially addresses #520 and #484.
In the spirit of exposing diagnostic functions to the user, this PR exports a function that users can call to obtain the names of the scoring rules used during scoring.
Specifically, the PR
get_metrics()
toget_score_names()
error = FALSE
to the function, controlling whether or not the function should error if no stored attributes are foundmetric_names
attribute toscore_names
and replaces it everywhereplot_ranges()
by wrapping a call toscore()
insuppressWarnings()
. This is more of a hotfix, and the future ofplot_ranges()
is discussed in Discussion: Future of functionplot_ranges()
?聽#462.Further thoughts:
There is probably an argument to be had about whether
score_names
is the best name. According to #520, "scores are computed by scoring rules". So the score is the output of a scoring rule. In some sense, the function gives you the names of the columns that hold the scores. Is that the name of the score? The name of the scoring rule? 馃しThe current name felt sufficiently concise and clear to me, but I don't have a strong opinion. Other naming options that I thought about:
get_rules()
with attributerule_names
get_names_rules()
get_rule_names()
Any thoughts?
Checklist
lintr::lint_package()
to check for style issues introduced by my changes.I have added a news item linked to this PR.