Learn R Programming

TDMR (version 2.2)

tdmPreSFA.apply: Apply SFA (Slow Feature Analysis) to new data.

Description

The SFA projection is taken from sfaList, a value returned from a prior call to tdmPreSFA.train.

Usage

tdmPreSFA.apply(dset, sfaList, opts, dtrain = NULL)

Arguments

dset

the data frame with the new data

sfaList

a value returned from a prior call to tdmPreSFA.train

opts

a list from which we need here the following entries:

  • PRE.SFA.REPLACE: [T] =T: replace the original numerical columns with the SFA columns; =F: add the SFA columns

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

  • PRE.SFA.ODIM: [5] number of SFA output dimensions (slowest signals) to return

  • PRE.SFA.numericV vector with all column names in dset for which SFA 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 tdmPreSFA.train in sfa$dset.

Value

sfa, 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.SFA=="linear") or with names KP1, KP2, ... (in case PRE.SFA=="kernel") and optional with monomial columns added, if PRE.SFA.npc>0

numeric.variables

the new column names for PCs and for the monomials

See Also

tdmPreSFA.train