Skip to content

Commit

Permalink
correct interpretation of add_tailor(prop) (#248)
Browse files Browse the repository at this point in the history
also corrects documentation on default value.
  • Loading branch information
simonpcouch committed Sep 19, 2024
1 parent d230ce1 commit dd254f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion R/fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ make_inner_split <- function(object, data) {
class = if (is.null(method)) "mc_split" else method
)

# add_tailor(prop) is the proportion to train the postprocessor, while
# rsample::mc_cv(prop) is the proportion to train the model (#247)
prop <- object$post$actions$tailor$prop
rsample::inner_split(
mocked_split,
list(prop = if (is.null(prop)) 2/3 else prop)
list(prop = if (is.null(prop)) 2/3 else 1 - prop)
)
}

Expand Down
2 changes: 1 addition & 1 deletion R/post-action-tailor.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @param prop The proportion of the data in [fit.workflow()] that should be
#' held back specifically for estimating the postprocessor. Only relevant for
#' postprocessors that require estimation---see section Data Usage below to
#' learn more. Defaults to 2/3.
#' learn more. Defaults to 1/3.
#'
#' @param method The method with which to split the data in [fit.workflow()],
#' as a character vector. Only relevant for postprocessors that
Expand Down
2 changes: 1 addition & 1 deletion man/add_tailor.Rd

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

0 comments on commit dd254f8

Please sign in to comment.