The PCA rotation is taken from pcaList
, a value returned from a prior call to tdmPrePCA.train
.
tdmPrePCA.apply(dset, pcaList, opts, dtrain = NULL)
the data frame with the new data
a value returned from a prior call to tdmPrePCA.train
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.
[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
.
pca
, a list with entries:
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
the new column names for PCs and for the monomials