Learn R Programming

accSDA (version 1.1.3)

normalizetest: Normalize training data

Description

Normalize test data using output from the normalize() of the training data

Usage

normalizetest(Xtst, Xn)

Value

normalizetest returns the normalized test data Xtst

Arguments

Xtst

a matrix with the test data with observations down the rows and variables in the columns.

Xn

List with the output from normalize(Xtr) of the training data.

Author

Line Clemmensen

Details

This function can e.g. be used for the test data in the predict.ASDA function.

References

Clemmensen, L., Hastie, T. and Ersboell, K. (2008) "Sparse discriminant analysis", Technical report, IMM, Technical University of Denmark

See Also

normalize, predict.ASDA, ASDA

Examples

Run this code
## Data
Xtr<-matrix(sample(seq(3),12,replace=TRUE),nrow=3)
Xtst<-matrix(sample(seq(3),12,replace=TRUE),nrow=3)

## Normalize training data
Nm<-normalize(Xtr)

## Normalize test data
Xtst<-normalizetest(Xtst,Nm)

Run the code above in your browser using DataLab