normalize | R Documentation |
Standardize the columns of an attribute matrix X
to zscores, to the
range [0 1]
or a prespecified scale.
normalize(x, standardize = "zscore")
x |
An attribute variable which will be scaled. |
standardize |
Either a string value denoting a predefined scaling, or a
list with values |
The standardized matrix. The numeric centering and scalings used are
returned as attribute "standardize"
.
Hok San Yip, Patrick J.F. Groenen, Georgi Nalbantov
P.J.F. Groenen, G. Nalbantov and J.C. Bioch (2008) SVM-Maj: a majorization approach to linear support vector machines with different hinge errors.
svmmaj
## standardize the first 50 objects to zscores
x <- iris$Sepal.Length
x1 <- normalize(x[1:50], standardize = 'zscore')
## use the same settings to apply to the next 100 observations
x2 <- normalize(x[-(1:50)], standardize = attr(x1, 'standardization'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.