mlr_pipeops_fda.fpca {mlr3fda} | R Documentation |
This PipeOp
applies a functional principal component analysis (FPCA) to functional columns and then
extracts the principal components as features. This is done using a (truncated) weighted SVD.
To apply this PipeOp
to irregualr data, convert it to a regular grid first using PipeOpFDAInterpol
.
For more details, see tf::tfb_fpc()
, which is called internally.
The parameters are the parameters inherited from PipeOpTaskPreproc
,
as well as the following parameters:
pve
:: numeric(1)
The percentage of variance explained that should be retained. Default is 0.995
.
n_components
:: integer(1)
The number of principal components to extract. This parameter is initialized to Inf
.
The new names generally append a _pc_{number}
to the corresponding column name.
If a column was called "x"
and the there are three principcal components, the corresponding
new columns will be called "x_pc_1", "x_pc_2", "x_pc_3"
.
mlr3pipelines::PipeOp
-> mlr3pipelines::PipeOpTaskPreproc
-> PipeOpFPCA
new()
Initializes a new instance of this Class.
PipeOpFPCA$new(id = "fda.fpca", param_vals = list())
id
(character(1)
)
Identifier of resulting object, default is "fda.fpca"
.
param_vals
(named list
)
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list()
.
clone()
The objects of this class are cloneable with this method.
PipeOpFPCA$clone(deep = FALSE)
deep
Whether to make a deep clone.
task = tsk("fuel")
po_fpca = po("fda.fpca", n_components = 3L)
task_fpca = po_fpca$train(list(task))[[1L]]
task_fpca$data()