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

require optional arguments to be named #151

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# workflowsets (development version)

* Ellipses (...) are now used consistently in the package to require optional arguments to be named; `collect_metrics()` and `collect_predictions()` are the only functions that received changes (#151, tidymodels/tune#863).
* Enabled evaluating censored regression models (#139, #144). The placement of
the new `eval_time` argument to `rank_results()` breaks passing-by-position
for the `select_best` argument.
Expand Down
10 changes: 6 additions & 4 deletions R/collect.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#'
#' @param x A [`workflow_set`][workflow_set()] object that has been evaluated
#' with [workflow_map()].
#' @param ... Not currently used.
#' @param summarize A logical for whether the performance estimates should be
#' summarized via the mean (over resamples) or the raw performance values (per
#' resample) should be returned along with the resampling identifiers. When
Expand All @@ -17,7 +18,6 @@
#' are retained. If `TRUE`, the `parameters` argument is ignored.
#' @param metric A character string for the metric that is used for
#' `select_best`.
#' @param ... Not currently used.
#' @return A tibble.
#' @details
#'
Expand Down Expand Up @@ -57,7 +57,8 @@
#'
#' collect_metrics(two_class_res, summarize = FALSE)
#' @export
collect_metrics.workflow_set <- function(x, summarize = TRUE, ...) {
collect_metrics.workflow_set <- function(x, ..., summarize = TRUE) {
rlang::check_dots_empty()
check_incompete(x, fail = TRUE)
check_bool(summarize)
x <-
Expand Down Expand Up @@ -98,8 +99,9 @@ reorder_cols <- function(x) {
#' @export
#' @rdname collect_metrics.workflow_set
collect_predictions.workflow_set <-
function(x, summarize = TRUE, parameters = NULL, select_best = FALSE,
metric = NULL, ...) {
function(x, ..., summarize = TRUE, parameters = NULL, select_best = FALSE,
metric = NULL) {
rlang::check_dots_empty()
check_incompete(x, fail = TRUE)
check_bool(summarize)
check_bool(select_best)
Expand Down
10 changes: 5 additions & 5 deletions man/collect_metrics.workflow_set.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading