sampling_bootstrap function

Sampling procedures used for testing capacity algorithm

Sampling procedures used for testing capacity algorithm

Internal, auxiliary functions

sampling_bootstrap(data, prob = 1, dataDiv) sampling_shuffle(data, side_variables) sampling_partition(data, dataDiv, partition_trainfrac)

Arguments

  • data: is a data.frame to be resampled
  • prob: is numeric for the portion of data that should be sampled from the whole dataset (only in sampling_bootstrap)
  • dataDiv: a character indicating column of data, with respect to which, data should be split before bootstrap
  • side_variables: is a vector of characters indicating columns of data the will be reshuffled (only in sampling_shuffle)
  • partition_trainfrac: is a numeric for the portion of data that will be used as a training and testing datasets

Returns

Function sampling_bootstrap returns a data.frame with the same structure as initial data object, but with prob proportion of observations for each dataDiv level. Function sampling_shuffle returns a data.frame with the same structure as initial data object with shuffled values of columns given in side_variables argument. Function sampling_partition returns a list of two data.frame objects - train and test that has the same structure as initial data argument with partition_trainfrac and 1-partition_trainfrac observations, respectively.

Details

These function allow to re-sample, bootstrap and divide initial dataset

Examples

data=data_example1 dataBootstrap = SLEMI:::sampling_bootstrap(data=data,prob=0.8,data$signal) dataShuffle = SLEMI:::sampling_shuffle(data=data,"sideVar") dataTrainTest = SLEMI:::sampling_partition(data=data,dataDiv=data$signal,partition_trainfrac=0.6)
  • Maintainer: Tomasz Jetka
  • License: GPL (>= 3)
  • Last published: 2023-11-19