Extracts principle components from data. Only affects numerical features.
stats::prcomp() for details.
R6Class object inheriting from
PipeOpPCA$new(id = "pca", param_vals = list())
Identifier of resulting object, default
param_vals :: named
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during construction. Default
Input and output channels are inherited from
The output is the input
Task with all affected numeric features replaced by their principal components.
$state is a named
list with the
$state elements inherited from
PipeOpTaskPreproc, as well as the elements of the class stats::prcomp,
with the exception of the
$x slot. These are in particular:
The standard deviations of the principal components.
The matrix of variable loadings.
The centering used, or
The scaling used, or
The parameters are the parameters inherited from
PipeOpTaskPreproc, as well as:
Indicating whether the features should be centered. Default is
Whether to scale features to unit variance before analysis. Default is
FALSE, but scaling is advisable. See
Maximal number of principal components to be used. Default is
NULL: use all components. See
Only methods inherited from
library("mlr3") task = tsk("iris") pop = po("pca") task$data() pop$train(list(task))[]$data() pop$state
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.