
Last chance! 50% off unlimited learning
Sale ends in
Normalize training and test set as obtained by splitForTrainingAndTest
in the following way:
The inputsTrain
member is normalized using normalizeData
with the parameters given in type
.
The normalization parameters obtained during this normalization are then used to normalize the inputsTest
member.
if dontNormTargets
is not set, then the targets are normalized in the same way. In classification problems,
normalizing the targets normally makes no sense. For regression, normalizing also the targets is usually a good idea.
The default is to not normalize targets values.
normTrainingAndTestSet(x, dontNormTargets = TRUE, type = "norm")
a named list with the same elements as splitForTrainingAndTest
, but with normalized values.
The normalization parameters are appended to each member of the list as attributes, as in normalizeData
.
a list containing training and test data. Usually the output of splitForTrainingAndTest
.
should the target values also be normalized?
type of the normalization. This parameter is passed to normalizeData
.
splitForTrainingAndTest
, normalizeData
, denormalizeData
,
getNormParameters
data(iris)
#shuffle the vector
iris <- iris[sample(1:nrow(iris),length(1:nrow(iris))),1:ncol(iris)]
irisValues <- iris[,1:4]
irisTargets <- decodeClassLabels(iris[,5])
iris <- splitForTrainingAndTest(irisValues, irisTargets, ratio=0.15)
normTrainingAndTestSet(iris)
Run the code above in your browser using DataLab