strucpca_warper: Structured principal component transformation of feature...

View source: R/strucpca_warper.R

strucpca_warperR Documentation

Structured principal component transformation of feature space

Description

This function offers a more structured approach to feature space transformation by allowing the user to transform different groups of predictor variables separately. It generates a warper object based on principal component analyses applied to the feature subsets.

Usage

strucpca_warper(
  xdata,
  xvars,
  wvars = NULL,
  yvar,
  uvars = NULL,
  center = TRUE,
  scale = TRUE,
  positive = TRUE,
  title = NULL
)

Arguments

xdata

A data frame containing the observations in the original feature space.

xvars

A list of character vectors with the column names of features in xdata that should be transformed. Variables named in each list component are jointly transformed using PCA. These groups shouldn't be too strongly correlated amongst each other.

wvars

A character vector of same length as xvars giving the prefixes to be used to generate the names of transformed predictors. If of length 1, use prefix wvars[1] for first feature subset, e.g. "PC[1]2" for second principal component from first feature subset if wvars[1] is "PC". If NULL, use "PC" as the prefix.

yvar

Name of the response variable (not to be transformed)

uvars

Optional list of same length as xvars with names of additional variables that should remain untouched.

center

Logical arguments indicating whether the data should be centered and then scales. Both should be turned on (TRUE), which is the default behaviour.

scale

Logical arguments indicating whether the data should be centered and then scales. Both should be turned on (TRUE), which is the default behaviour.

positive

Logical argument (default: TRUE) indicating whether the signs of the loadings should be adjusted so that the most strongly weighted PC gets a positive sign.

title

Optional name of the transformation, may be used for printing summaries or for plotting.

Value

An object of class warper, rotation_warper and strucpca_warper.


alexanderbrenning/wiml documentation built on Sept. 29, 2023, 4:45 a.m.