Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

normTrainingAndTestSet

Function to normalize training and test set


Description

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.

Usage

normTrainingAndTestSet(x, dontNormTargets = TRUE, type = "norm")

Arguments

x

a list containing training and test data. Usually the output of splitForTrainingAndTest.

dontNormTargets

should the target values also be normalized?

type

type of the normalization. This parameter is passed to normalizeData.

Value

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.

See Also

Examples

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)

RSNNS

Neural Networks using the Stuttgart Neural Network Simulator (SNNS)

v0.4-12
LGPL (>= 2) | file LICENSE
Authors
Christoph Bergmeir [aut, cre, cph], José M. Benítez [ths], Andreas Zell [ctb] (Part of original SNNS development team), Niels Mache [ctb] (Part of original SNNS development team), Günter Mamier [ctb] (Part of original SNNS development team), Michael Vogt [ctb] (Part of original SNNS development team), Sven Döring [ctb] (Part of original SNNS development team), Ralf Hübner [ctb] (Part of original SNNS development team), Kai-Uwe Herrmann [ctb] (Part of original SNNS development team), Tobias Soyez [ctb] (Part of original SNNS development team), Michael Schmalzl [ctb] (Part of original SNNS development team), Tilman Sommer [ctb] (Part of original SNNS development team), Artemis Hatzigeorgiou [ctb] (Part of original SNNS development team), Dietmar Posselt [ctb] (Part of original SNNS development team), Tobias Schreiner [ctb] (Part of original SNNS development team), Bernward Kett [ctb] (Part of original SNNS development team), Martin Reczko [ctb] (Part of original SNNS external contributors), Martin Riedmiller [ctb] (Part of original SNNS external contributors), Mark Seemann [ctb] (Part of original SNNS external contributors), Marcus Ritt [ctb] (Part of original SNNS external contributors), Jamie DeCoster [ctb] (Part of original SNNS external contributors), Jochen Biedermann [ctb] (Part of original SNNS external contributors), Joachim Danz [ctb] (Part of original SNNS development team), Christian Wehrfritz [ctb] (Part of original SNNS development team), Patrick Kursawe [ctb] (Contributors to SNNS Version 4.3), Andre El-Ama [ctb] (Contributors to SNNS Version 4.3)
Initial release
2019-09-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.