normalizetest: Normalize test data

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
9
## 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)


Search within the sparseLDA package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.