Skip to content

Commit

Permalink
Updated example for nested_cv()
Browse files Browse the repository at this point in the history
Replaced as.data.frame() by the rsample accessor functions and changed the car name - Fixes #479
  • Loading branch information
seb09 committed Aug 15, 2024
1 parent 5eb77d4 commit e1f658d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions R/nest.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
#' inside = vfold_cv(v = 3)
#' )
#'
#' first_outer_split <- bad_idea$splits[[1]]
#' outer_analysis <- as.data.frame(first_outer_split)
#' sum(grepl("Volvo 142E", rownames(outer_analysis)))
#' first_outer_split <- get_rsplit(bad_idea, 1)
#' outer_analysis <- analysis(first_outer_split)
#' sum(grepl("Camaro Z28", rownames(outer_analysis)))
#'
#' ## For the 3-fold CV used inside of each bootstrap, how are the replicated
#' ## `Volvo 142E` data partitioned?
#' first_inner_split <- bad_idea$inner_resamples[[1]]$splits[[1]]
#' inner_analysis <- as.data.frame(first_inner_split)
#' inner_assess <- as.data.frame(first_inner_split, data = "assessment")
#' ## `Camaro Z28` data partitioned?
#' first_inner_split <- get_rsplit(bad_idea$inner_resamples[[1]], 1)
#' inner_analysis <- analysis(first_inner_split)
#' inner_assess <- assessment(first_inner_split)
#'
#' sum(grepl("Volvo 142E", rownames(inner_analysis)))
#' sum(grepl("Volvo 142E", rownames(inner_assess)))
#' sum(grepl("Camaro Z28", rownames(inner_analysis)))
#' sum(grepl("Camaro Z28", rownames(inner_assess)))
#' @export
nested_cv <- function(data, outside, inside) {
cl <- match.call()
Expand Down
18 changes: 9 additions & 9 deletions man/nested_cv.Rd

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

0 comments on commit e1f658d

Please sign in to comment.