augment: Replicate observations with added noise.

Description Usage Arguments Value

View source: R/merged_list_functions.r

Description

This function creates copies of existing observations in the training set with a specified amount of noise added to each numeric variable/observation combination with a non-zero value using data.table. This includes taxa abundance and also sample data variables. Pure integer columns are ignored, as they are either all 0s or dummy columns (only 0 and 1) and represent factor levels. The response variable is also ignored. Copies are named according to this scheme: original: "Sample_1", first copy: "Sample_1.1", second copy: "Sample_1.2" etc The actual work is performed by internal 'augment_and_noise()' function.

Usage

1
augment(splitted_list, copy_number, noise_factor)

Arguments

splitted_list

a list of complimentary training and test data sets named "train_set" and "test_set", e.g 'mylist[[1]][["train_set"]]' and 'mylist[[1]][["test_set"]]' for the first list item

copy_number

an integer specifying the number of copies, 0 means no augmentation takes place and 'noise_factor' is ignored

noise_factor

a value >= 0 specifing the relative amount of noise randomly added or substracted to/from the original value e.g. 0.05 == +-5 % noise

Value

A list of lists, the list item name is updated to reflect the number of copies and the noise value


RJ333/phyloseq2ML documentation built on June 2, 2020, 9:25 p.m.