PrepareData: Preprocess Data

Description Usage Arguments Value Examples

View source: R/PrepareData.R

Description

Preprocesses data based on input

Usage

1
PrepareData(path, mode = 0, sample = FALSE, size = 1000)

Arguments

path

provides path to training and test data

mode

Defines the kind of preprocessing to be done. mode 0 does not process any data but seperates features from labels and returns a training set and a test set. mode1 creates z scores out of all the continuous features in training data set For test data set the training sample means and sample variances are used to normalize data. mode 2 resizes all continuous features between 0 and 1

sample

If sample is set to TRUE only a subset of processed data is returned

size

The size of subset of data to be returned of sample set to TRUE

Value

A list with two components. train - A list with two components. One is a vector of labels, the other is a data frame of features. test - If mode is not 1 A data frame of features. Else a list where one component is the sample mean and sample sd used to normalize data and the other component is the list of test features

Examples

1
2
path <- "/home/rishabh/mres/ml_comp/data/"
data <- PrepareData(path, mode = 2, sample = TRUE, size = 100)

rishi1226/classrish documentation built on May 27, 2019, 9:10 a.m.