kernelLaplacian {MMOC} | R Documentation |
Calculate the graph Laplacian of a given data set
Description
Calculate the graph laplacian from a given data set with subjects as rows and features as columns.
Usage
kernelLaplacian(
dat,
kernel = c("Gaussian", "ZM", "Spectrum", "Linear"),
laplacian = c("shift", "Ng", "sym", "rw"),
grf.type = c("full", "knn", "e-graph"),
k = 5,
p = 5,
rho = NULL,
epsilon = 0,
mutual = FALSE,
binary.grf = FALSE,
plots = TRUE,
verbose = TRUE
)
Arguments
dat |
A matrix like object with subjects as rows and features as columns. |
kernel |
The type of kernel used to calculate the graph's adjacency matrix: |
laplacian |
One of |
grf.type |
Type of graph to calculate: |
k |
An integer value for |
p |
An integer value for the p-nearest neighbor in the |
rho |
A value for the dispersion parameter in the Gaussian kernel. It is in the denominator of the exponent, so higher values correspond to lower similarity. By default it is the median pairwise Gaussian distance |
epsilon |
The cutoff value for the |
mutual |
Make a "mutual" knn graph. Only keeps edges when two nodes are both in each others k-nearest set |
binary.grf |
Set all edges >0 to 1 |
plots |
Whether or not to plot the final graph, a heatmap of calculated kernel, and the eigen values of the Laplacian |
verbose |
Whether or not to give some summary statistics of the pairwise distances |
Details
The four Lapalacians are defined as L_{shift}=I+D^{-1/2}AD^{-1/2}
, L_{Ng}=D^{-1/2}AD^{-1/2}
, L_{sym}=I-D^{-1/2}AD^{-1/2}
, and L_{rw}=I-D^{-1}A
. The shifted Laplacian, L_{shift}=I+D^{-1/2}AD^{-1/2}
, is recommended for multi-view spectral clustering.
Value
An n\times
n matrix where n
is the number of rows in dat
.
References
https://academic.oup.com/bioinformatics/article/36/4/1159/5566508#199177546
Examples
## Generating data with 3 distinct clusters
## Note that 'clustStruct' returns a list
dd <- clustStruct(n=120, p=30, k=3, noiseDat='random')[[1]]
kernelLaplacian(dd, kernel="Spectrum")