tdmPrePCA.apply: Apply PCA (Principal Component Analysis) to new data.

Description Usage Arguments Value Author(s) See Also

View source: R/tdmPreprocUtils.r

Description

The PCA rotation is taken from pcaList, a value returned from a prior call to tdmPrePCA.train.

Usage

1
tdmPrePCA.apply(dset, pcaList, opts, dtrain = NULL)

Arguments

dset

the data frame with the new data

pcaList

a value returned from a prior call to tdmPrePCA.train

opts

a list from which we need here the following entries:

  • PRE.knum: if >0 and if PRE.PCA="kernel", take only a subset of PRE.knum records from dset

  • PRE.PCA.npc: if >0, then add for the first PRE.PCA.npc PCs the monomials of degree 2 (see tdmPreAddMonomials)

  • PRE.PCA.numericV vector with all column names in dset for which PCA is performed. These columns may contain *numeric* values only.

dtrain

[NULL] optional, only needed in case that dset is a 0-row-data frame: then we 'borrow' the columns from dtrain, the data set returned from tdmPrePCA.train in pca$dset.

Value

pca, a list with entries:

dset

the input data frame dset with columns numeric.variables replaced by the PCs with names PC1, PC2, ... (in case PRE.PCA=="linear") or with names KP1, KP2, ... (in case PRE.PCA=="kernel") and optional with monomial columns added, if PRE.PCA.npc>0

numeric.variables

the new column names for PCs and for the monomials

Author(s)

Wolfgang Konen, FHK, Mar'2011 - Jan'2012

See Also

tdmPrePCA.train


TDMR documentation built on March 3, 2020, 1:06 a.m.