extract_set {alookr} | R Documentation |
Extract train/test dataset
Description
Extract train set or test set from split_df class object
Usage
extract_set(x, set = c("train", "test"))
Arguments
x |
an object of class "split_df", usually, a result of a call to split_df(). |
set |
character. Specifies whether the extracted data is a train set or a test set. You can use "train" or "test". |
Details
Extract the train or test sets based on the parameters you defined when creating split_df with split_by().
Value
an object of class "tbl_df".
Examples
library(dplyr)
# Credit Card Default Data
head(ISLR::Default)
# Generate data for the example
sb <- ISLR::Default %>%
split_by(default)
train <- sb %>%
extract_set(set = "train")
test <- sb %>%
extract_set(set = "test")
[Package alookr version 0.3.9 Index]