l1_spectralclustering: Run the l1-spectral clustering algorithm

Description Usage Arguments Value Author(s) See Also Examples

View source: R/l1_spectralclustering.R

Description

This function runs the l1-spectral algorithm, an l1-penalized version of the spectral clustering that aims at robustly clustering perturbed graphs.

Usage

1
2
3
4
5
6
7
8
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:

Author(s)

Camille Champion, Magali Champion

See Also

ComputePerformances, l1spectral.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 #####################################################
 # 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))

l1spectral documentation built on Jan. 27, 2022, 1:07 a.m.