powered by
This function is a data augmentation technique. It duplicates rows and add gaussian noise to the duplicates.
augmentation(dataset, target, n = 5, sigma = 0.1, seed = NULL)
An augmented dataset.
The dataset to be split (data.frame or matrix).
data.frame
matrix
The column index (numeric) or column name (character) of the target variable (class label or response variable).
The scaling factor (as an integer value): the output contains n times the original dataset (the original rows, plus n - 1 noisy copies).
n
n - 1
The baseline variance for the noise generation.
A specified seed for random number generation.
require (datasets) data (iris) d = augmentation (iris, 5) summary (iris) summary (d) # 'target' can also be given as a column name d = augmentation (iris, "Species")
Run the code above in your browser using DataLab