-
Notifications
You must be signed in to change notification settings - Fork 42
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
Pivot metrics #689
Pivot metrics #689
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.
Been sitting with this and wanted to open a discussion before reviewing any technical bits: would this be better situated as an argument to collect_metrics()
?
My hesitancy with pivot_metrics()
is that the name currently suggests to me that its input is the output of collect_metrics()
or metrics()
, and the only alternatives I can think of for a name change seem ambiguous with collect_metrics()
. I would also make the case this the name of this function should start with collect_*()
, as this feels like a collection action and that naming would better support tab-completion. This function does feel more to me like an alternative usage of collect_metrics()
than a different function altogether.
Transitioning this to a pivot
argument with logical values, or type = c("long", "wide")
, would also mean we wouldn't have to maintain a separate usage of this column identification boilerplate:
Lines 485 to 495 in dde5d35
param_names <- .get_tune_parameter_names(x) | |
id_names <- grep("^id", names(x), value = TRUE) | |
group_cols <- .get_extra_col_names(x) | |
all_bad <- is_cataclysmic(x) | |
if (all_bad) { | |
rlang::abort("All models failed. Run `show_notes(.Last.tune.result)` for more information.") | |
} | |
# The mapping of tuning parameters and .config. | |
config_key <- .config_key_from_metrics(x) |
Closing in favor of #839. :) |
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
A function to collect metrics then
pivot_wider()
on them so that metrics are in columns.