Add accuracy metric to results stats summary#31
Merged
mccarthy-m-g merged 5 commits intomainfrom Nov 10, 2025
Merged
Conversation
Contributor
Agree with this approach, otherwise there is too much chance of users just relying on what is default. |
Collaborator
Author
|
One Q for printing: Right now we're printing accuracy with NAs for each type when it isn't being calculated. Do you like that, or should we remove the accuracy column from printing when it isn't calculated? To hide it, we just need to add a select statement to tibble(x = rep(NA, times = 5), y = 1:5) |> select(where(\(.x) all(!is.na(.x))))
#> # A tibble: 5 × 1
#> y
#> <int>
#> 1 1
#> 2 2
#> 3 3
#> 4 4
#> 5 5 |
| nrmse = c(0.411, 0.232, 0.199, 0.121, 0.486, 0.232), | ||
| mpe = c(-0.339, -0.004, -0.045, -0.002, -0.415, -0.004), | ||
| mape = c(0.445, 0.246, 0.166, 0.118, 0.558, 0.246), | ||
| accuracy = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_, NA_real_) |
Contributor
There was a problem hiding this comment.
would include at least one end-to-end test for run_eval() where we do calculate it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an (optional) accuracy metric to the results stats summary of
run_eval()(#30).The main challenge for this one was defining the API, since unlike other error metrics, the user needs to define the absolute and relative error margins for whether a prediction is considered accurate or not. I opted to only calculate accuracy if the user has supplied the absolute and relative error margins (via a new
.stats_summ_optionsargument and correspondingstats_summ_options()function). This lets us avoid defining universally suitable defaults, which is probably difficult to do appropriately.The API looks like this: