# row rec form
d_rowrec_form <- wrapr::build_frame(
  'val_loss', 'val_acc', 'loss', 'acc' , 'epoch' |
  0.377     , 0.8722   , 0.5067, 0.7852, 1L      |
  0.2997    , 0.8895   , 0.3002, 0.904 , 2L      |
  0.2964    , 0.8822   , 0.2166, 0.9303, 3L      |
  0.2779    , 0.8899   , 0.1739, 0.9428, 4L      |
  0.2843    , 0.8861   , 0.1411, 0.9545, 5L      |
  0.312     , 0.8817   , 0.1136, 0.9656, 6L      )

# block form
d_block_form <- wrapr::build_frame(
  'epoch', 'measure'                   , 'training', 'validation' |
  1L     , 'accuracy'                  , 0.8722    , 0.7852       |
  1L     , 'minus binary cross entropy', 0.377     , 0.5067       |
  2L     , 'accuracy'                  , 0.8895    , 0.904        |
  2L     , 'minus binary cross entropy', 0.2997    , 0.3002       |
  3L     , 'accuracy'                  , 0.8822    , 0.9303       |
  3L     , 'minus binary cross entropy', 0.2964    , 0.2166       |
  4L     , 'accuracy'                  , 0.8899    , 0.9428       |
  4L     , 'minus binary cross entropy', 0.2779    , 0.1739       |
  5L     , 'accuracy'                  , 0.8861    , 0.9545       |
  5L     , 'minus binary cross entropy', 0.2843    , 0.1411       |
  6L     , 'accuracy'                  , 0.8817    , 0.9656       |
  6L     , 'minus binary cross entropy', 0.312     , 0.1136       )

# conversion control table
controlTable <- wrapr::build_frame(
  'measure'                   , 'training', 'validation' |
  'minus binary cross entropy', 'loss'    , 'val_loss'   |
  'accuracy'                  , 'acc'     , 'val_acc'    )


cdata::rowrecs_to_blocks(d_rowrec_form, controlTable, columnsToCopy = "epoch", use_data_table = TRUE)
cdata::rowrecs_to_blocks(d_rowrec_form, controlTable, columnsToCopy = "epoch", use_data_table = FALSE)

cdata::blocks_to_rowrecs(d_block_form, controlTable, keyColumns = "epoch", use_data_table = TRUE)
cdata::blocks_to_rowrecs(d_block_form, controlTable, keyColumns = "epoch", use_data_table = FALSE)


WinVector/cdata documentation built on Aug. 29, 2023, 3:56 a.m.