summary method for "split_df" class.
# S3 method for split_df
summary(object, ...)
an object of class "split_df", usually, a result of a call to split_df().
further arguments passed to or from other methods.
NULL is returned. However, the split train set and test set information are displayed. The output information is as follows.:
Random seed
Number of train sets and test sets
Name of target variable
Target variable minority class and majority class information (label and ratio)
summary.split_df provides information on the number of two split data sets, minority class and majority class.
library(dplyr)
# Credit Card Default Data
head(ISLR::Default)
#> default student balance income
#> 1 No No 729.5265 44361.625
#> 2 No Yes 817.1804 12106.135
#> 3 No No 1073.5492 31767.139
#> 4 No No 529.2506 35704.494
#> 5 No No 785.6559 38463.496
#> 6 No Yes 919.5885 7491.559
# Generate data for the example
sb <- ISLR::Default %>%
split_by(default)
sb
#> # A tibble: 10,000 × 5
#> # Groups: split_flag [2]
#> default student balance income split_flag
#> <fct> <fct> <dbl> <dbl> <chr>
#> 1 No No 730. 44362. train
#> 2 No Yes 817. 12106. train
#> 3 No No 1074. 31767. test
#> 4 No No 529. 35704. train
#> 5 No No 786. 38463. test
#> 6 No Yes 920. 7492. test
#> 7 No No 826. 24905. test
#> 8 No Yes 809. 17600. test
#> 9 No No 1161. 37469. train
#> 10 No No 0 29275. test
#> # ℹ 9,990 more rows
summary(sb)
#> ** Split train/test set information **
#> + random seed : 93222
#> + split data
#> - train set count : 7000
#> - test set count : 3000
#> + target variable : default
#> - minority class : Yes (0.033300)
#> - majority class : No (0.966700)