Description Usage Arguments Value Author(s) See Also Examples
This internal function of the l1-spectral clustering algorithm finds representative elements of the clusters, that is nodes belonging to the clusters.
1 | FindElement(A, structure, clusters, elements = NULL)
|
A |
The adjacency matrix |
structure |
Output of the function |
clusters |
Output of the function |
elements |
The representative elements of the clusters (not necessary needed). If not provided, chosen using the betweeness centrality score. |
A list with the following elements:
score
The edge betweenness score of all nodes,
Nodes
Vector of the representative elements.
Camille Champion, Magali Champion
l1_spectralclustering
, l1spectral
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ######################################################
# Finding the representative elements of the clusters
######################################################
# 1st: create data (not perturbed graph)
Data <- CreateDataSet(k=3, n=20, p=list(p_inside=0,p_outside=0))
# 2nd: find the structure of the graph
Structure <- FindStructure(Data$A_hat)
# 3rd: find the optimal number of clusters (here, 3 clusters)
Clusters <- FindNbrClusters(A = Data$A_hat, structure = Structure, k=3)
# 4th: find the representative elements of the clusters
Elements <- FindElement(A = Data$A_hat, structure = Structure, clusters = Clusters)
# if elements is not provided, the representative elements of each component are chosen
# by maximizing the edge betweenness score
Elements <- FindElement(A = Data$A_hat, structure = Structure,
clusters = Clusters, elements = c(1,5,12))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.