normalizetest {sparseLDA}R Documentation

Normalize test data

Description

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

Usage

normalizetest(Xtst,Xn)

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.

Details

The function can e.g. be used to normalize the testing data in sda or smda.

Value

Returns the normalized test data

Xtst

The normalized data.

Author(s)

Line Clemmensen

References

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

See Also

normalize, sda, smda

Examples

## 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)

[Package sparseLDA version 0.1-9 Index]