l1_spectralclustering {l1spectral} | R Documentation |
Run the l1-spectral clustering algorithm
Description
This function runs the l1-spectral algorithm, an l1-penalized version of the spectral clustering that aims at robustly clustering perturbed graphs.
Usage
l1_spectralclustering(
A,
k = NULL,
k_max = NULL,
elements = NULL,
pen,
stab = TRUE
)
Arguments
A |
The adjacency matrix of the graph to cluster. |
k |
True number of clusters (not necessarily needed). If not provided, k is chosen by spectral eigengap. |
k_max |
Maximal number of clusters to form (not necessarily needed). If not provided, k_max is set to the number of nodes. |
elements |
The representative elements of the clusters (not necessary needed). If not provided, index are chosen using the betweeness centrality score. |
pen |
The penalty (to be chosen among "lasso" or "thresholdedLS"). |
stab |
TRUE/FALSE indicated whether the indices should be stabilized (TRUE by default) |
Value
A list with the following elements:
comm
The community matrix,structure
The structure of the graph to cluster,clusters
The number of clusters,elements
The chosen representative elements of the clusters.
Author(s)
Camille Champion, Magali Champion
See Also
ComputePerformances
, l1spectral
.
Examples
#####################################################
# Performing the l1-spectral clustering on the graph
#####################################################
data(ToyData)
# if desired, the number of clusters and representative elements can be provided, otherwise, remove
results2 <- l1_spectralclustering(A = ToyData$A_hat, pen = "lasso")
results2$comm
# when desired, the number of clusters and representative elements can also be provided
results2 <- l1_spectralclustering(A = ToyData$A_hat, pen = "lasso",
k=2, elements = c(1,4))