normTrainingAndTestSet | R Documentation |
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")
x |
a list containing training and test data. Usually the output of |
dontNormTargets |
should the target values also be normalized? |
type |
type of the normalization. This parameter is passed to |
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
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.