Slide 30
Slide 30 text
PROPROCESSING
EXAMPLES IN R
ind <- sample(3, nrow(data), replace=TRUE,
prob=c(0.6, 0.2, 0.2))
trainData <- data[ind==1,]
valData <- data[ind==2,]
testData <- data[ind==3,]
trainMaxs <- apply(trainData[,1:11], 2, max)
trainMins <- apply(trainData[,1:11], 2, min)
normTrainData <-
sweep(sweep(trainData[,1:11], 2, trainMins, "-"),
2, (trainMaxs - trainMins), "/")
summary(normTrainData)