When performing kPCA with step_kpca()
, you must choose the kernel
function (and any important kernel parameters). This step uses the
kernlab package; the reference below discusses the types of kernels
available and their parameter(s). These specifications can be made in the
kernel
and kpar
slots of the options
argument to step_kpca()
.
Consider using step_kpca_rbf()
for a radial basis function kernel or
step_kpca_poly()
for a polynomial kernel.
Kernel principal component analysis (kPCA) is an extension of a PCA analysis
that conducts the calculations in a broader dimensionality defined by a
kernel function. For example, if a quadratic kernel function were used,
each variable would be represented by its original values as well as its
square. This nonlinear mapping is used during the PCA analysis and can
potentially help find better representations of the original data.
This step requires the kernlab package.
If not installed, the step will stop with a prompt about installing
the package.
As with ordinary PCA, it is important to center and scale the variables
prior to computing PCA components (step_normalize()
can be used for
this purpose).
The argument num_comp
controls the number of components that will be
retained; the original variables that are used to derive the components are
removed from the data when keep_original_cols = FALSE
. The new components
will have names that begin with prefix
and a sequence of numbers. The
variable names are padded with zeros. For example, if num_comp < 10
, the
new names will be kPC1
- kPC9
. If num_comp = 101
, the names would be
kPC001
- kPC101
.