Skip to content
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

Closed
wants to merge 5 commits into from
Closed

Pivot metrics #689

wants to merge 5 commits into from

Conversation

topepo
Copy link
Member

@topepo topepo commented Jun 10, 2023

A function to collect metrics then pivot_wider() on them so that metrics are in columns.

@topepo topepo marked this pull request as ready for review June 12, 2023 22:28
@topepo topepo requested a review from simonpcouch June 15, 2023 15:33
Copy link
Contributor

@simonpcouch simonpcouch left a 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:

tune/R/collect.R

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)

@simonpcouch
Copy link
Contributor

Closing in favor of #839. :)

@simonpcouch simonpcouch deleted the pivot-metrics branch January 31, 2024 22:18
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants