Projects numeric features onto a randomly sampled subspace. All numeric features
(or the ones selected by
affect_columns) are replaced by numeric features
Samples with features that contain missing values result in all
NA for that sample, so it is advised to do imputation before random projections
if missing values can be expected.
R6Class object inheriting from
PipeOpRandomProjection$new(id = "randomprojection", 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 affected numeric features
projected onto a random subspace.
$state is a named
list with the
$state elements inherited from
as well as an element
The parameters are the parameters inherited from
PipeOpTaskPreproc, as well as:
The dimension of the subspace to project onto. Initialized to 1.
If there are
n (affected) numeric features in the input
$state$projection is a
matrix. The output is calculated as
input %*% state$projection.
The random projection matrix is obtained through Gram-Schmidt orthogonalization from a matrix with values standard normally distributed, which gives a distribution that is rotation invariant, as per Eaton: Multivariate Statistics, A Vector Space Approach, Pg. 234.
Only methods inherited from
library("mlr3") task = tsk("iris") pop = po("randomprojection", rank = 2) 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.