-
Notifications
You must be signed in to change notification settings - Fork 20
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
metrics_ -> metrics.scoringutils.quantile etc #832
Comments
But it would also make it a bit harder to customise your own lists of functions, wouldn't it? Because you'd always have to pass in a
|
why? You can just call the underlying list (i.e metrics.class()) directly? |
So this would boil down to people calling something like @Bisaloo what are your thoughts on this? |
yees exactly + better match the overall package design. The push back to doing this is that currently all thee metrics themselves have _sample etc names so the current approach is consistent with that |
Yes, it sounds like a good idea to me. It would reduce the (visible) As previously mentioned, any reasonable solution that reduces scoringutils' NAMESPACE is probably a win in terms of usability in my opinion. |
Oh.. this is annoying. the problem with a setup like this:
is Also the
I don't think this is a hard blocker (we can replace |
Options: A) staying with I'm voting for either A or B. We moved away from What do you think @seabbs @sbfnk @Bisaloo @jamesmbaazam ? |
I have a slight preference for B and regardless of it being s3 slightly prefer the name as it is more accurate.
I agree this is a bit unwieldy but I think the upside of having fewer function names for people to find + automation is worth it. I also don't think accessing via |
Other opinions on this? :) |
I cannot answer anything useful because I'm still struggling to understand #832 (comment). My gut feeling (perhaps completely wrong since I don't fully understand what's going on) is that we can do something about this error without changing anything else in the proposed arguments or structure. Is it possible to push the broken code to a branch so we can have a look and experiment? |
The general issue is that R doesn't allow you to pass something to an argument that has the same name of that argument. e.g. the following leads to an error:
So we can't have a function
Previously,
worked because the names were different. |
(not sure this is what actually what confused you - happy to create another branch if you like) |
Oooh, that makes sense, thanks for explaining! I'd go with B with a small change: convert the function name to a verb, such as |
We currently already have a function I don't like the function because I don't like having to rely on the attribute of the |
is our current |
It's exported and it's used in functions like this:
This is the function definition of scoringutils/R/get_-functions.R Line 191 in 4d9ecf7
We could rename |
get_scored_metrics maybe is a better fit anyway? |
Just noting that another benefit of this change is we can reduce the number of custom methods that there are for score as for a few of them the metrics list is the only current difference (this would require relying on a common forecast class). see here: https://github.com/epiforecasts/scoringutils/blob/main/R/score.R This could help with #852 as it could reduce the amount of boiler plate users have to right |
Perhaps this wouldn't really be likely to happen though. In the nominal case this wouldn't have saved any code for example (https://github.com/epiforecasts/scoringutils/pull/837/files) |
Current contenders are: B1:
B2:
B3:
|
my preference is B1 but I recognise it is more change. I like it as a proposal as it makes it clear where get_scored_metrics is getting its metrics from which I am not sure was true in the past? |
Luckily, we now also have B3 :D |
the future of the world hangs on a knife edge.. I still prefer B1.... |
I think my argument is the same that you made about the previous |
so what about The bit I don't like about that is that if you select as an arg then it is no longer return the defaults so the name is not quite right (so I would still fall back on preferring |
Having done some waiting coupled with no new revelations, I propose we go with For getting the metrics that were actually used for scoring we could either use What do you think? Noting that this PR https://github.com/hubverse-org/hubEvals/pull/46/files will break with the changes here (cc @elray1), so we need to coordinate this a bit. |
There is one additional change I propose. we previously discussed for our example data to be already validated objects rather than raw data.tables. My previous argument was "it's nice to demonstrate the With the change we are discussing here I think the benefits of being able to look at default metrics by calling |
I think I agree on all points. I was a little worried by the auto-magical idea of having a score method for |
As the title it seems like
metrics_
functions should be exported to S3 methods? They can dispatch on the input toscore
when used in the default mode. This would streamline adding a custom thing to score etc.The text was updated successfully, but these errors were encountered: