Skip to contents

First we take a packed dataframe with three columns:

  • segment - taken from shelf$segment

  • weight - taken from shelf$data$weight

  • x - shelf$data$x - a dataframe-column containing features that were used for training NMF. We reorder these columns by their importance, most important go first.

Then we split the rows of such a dataframe into 75%/25% train/test parts. Then for each n_var we generate train/test data as data from the previous step but where only n_var first vars is left in x dataframe-column. The result is a nested dataframe with 3 columns:

  • n_var

  • train - train data for the corresponding number of features

  • test - test data for the corresponding number of features

Usage

shelf_make_tt_data_cuts(shelf, n_var = c(5, 8, 10, 12, 15))

Arguments

shelf

A rack shelf, or in other words, a row of a model rack extracted with rack_extract_shelf().

n_var

An integer vector describing different numbers of features to try for training typing tools. Features are taken based on their importance, most important always go first.

Examples

shelf_make_tt_data_cuts(example_seg_shelf)
#> # A tibble: 5 × 3
#>   n_var train             test             
#>   <dbl> <list>            <list>           
#> 1     5 <tibble [74 × 3]> <tibble [26 × 3]>
#> 2     8 <tibble [74 × 3]> <tibble [26 × 3]>
#> 3    10 <tibble [74 × 3]> <tibble [26 × 3]>
#> 4    12 <tibble [74 × 3]> <tibble [26 × 3]>
#> 5    15 <tibble [74 × 3]> <tibble [26 × 3]>