powered by
Normalize a vector or matrix to zero mean and unit length columns.
normalize(X)
normalize Returns a list with the following attributes:
normalize
The normalized data
Mean of columns of X.
X
Length of columns of X.
Logical vector indicating which variables are included in X. If some of the columns have zero length they are omitted
a matrix with the training data with observations down the rows and variables in the columns.
Line Clemmensen
This function can e.g. be used for the training data in the ASDA function.
ASDA
Clemmensen, L., Hastie, T. and Ersboell, K. (2008) "Sparse discriminant analysis", Technical report, IMM, Technical University of Denmark
normalizetest, predict.ASDA, ASDA
normalizetest
predict.ASDA
## Data X<-matrix(sample(seq(3),12,replace=TRUE),nrow=3) ## Normalize data Nm<-normalize(X) print(Nm$Xc) ## See if any variables have been removed which(!Nm$Id)
Run the code above in your browser using DataLab