kernPCA: kernel PCA

Description Usage Arguments Value Examples

View source: R/unsupervised.R

Description

kernel PCA

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
kernPCA(
  data,
  comb = "mean",
  kernel,
  plot = TRUE,
  H = NULL,
  domain = NULL,
  y,
  dim = c(1, 2),
  colors,
  na.col = "grey70",
  title,
  legend = TRUE,
  labels = FALSE
)

Arguments

data

Input data: a matrix or data.frame.

comb

If data is a list or array: how to combine them ("mean","statis","full","sparse" or a vector of coefficients)

kernel

lin" or rbf" to standard Linear and RBF kernels. "clin" for compositional linear and "crbf" for Aitchison-RBF kernels. "jac" for quantitative Jaccard / Ruzicka kernel. "jsk" for Jensen-Shannon Kernel. "flin" and "frbf" for functional linear and functional RBF kernels. "matrix" if a pre-computed kernel matrix is given as input. With an array or a list of length *m*: Vector of *m* kernels to apply to each dataset.

plot

TRUE to return the plot, FALSE to return the projection object

H

Kernel gamma hyperparameter if needed (only RBF-like kernels)

domain

Only used in "frbf" or "flin".

y

Response vector; optional. Colors each dot (individual) according to its value in the response / target variable.

dim

The two PC that have to be displayed. Defaults to the two first PC.

colors

Dot fill color; optional.

na.col

Depends on y and colors. Dot fill color for the y missing values; defaults to grey.

title

Plot title

legend

Defaults to TRUE. A legend with the color corresponding to each y value.

labels

If true, each dot will be labeled with its row number.

Value

A k-PCA plot generated with ggplot2.

Examples

1
2
3
4
5
6
7
8
kernPCA(soil$abund,kernel="clin", y=soil$metadata$phd, colors=c("orange","orchid3"),
title = "Soil kernel PCA",legend = TRUE)
## Heterogeneous data fusion case
Airway <- list()
Airway$nosel <- CSSnorm(smoker$abund$oroL)
Airway$throatl <- CSSnorm(smoker$abund$oroR)
smoking <- smoker$metadata$smoker[seq(from=1,to=62*4,by=4)]
kernPCA(data=Airway,kernel=rep("jac",2),title="Airway samples",y=smoking)#'

Yuliaxis/kernInt documentation built on Feb. 20, 2022, 12:38 a.m.