Description Usage Arguments Value Author(s) See Also Examples
View source: R/CreateDataSet.R
This function generates toy data that can be used to run the l1-spectal clustering algorithm: the adjacency matrix of a graph with n
nodes and its perturbed version.
1 | CreateDataSet(k, n, p, print.plot = TRUE, ClustersLength = NULL)
|
k |
True number of clusters. |
n |
Number of nodes. |
p |
List of probabilities of perturbations (inside and outside clusters). |
print.plot |
TRUE/FALSE indicated whether the graph should be plotted. |
ClustersLength |
Length of the |
A list with the following elements:
A
Adjacency matrix of the generated graph.
A_hat
Adjacency matrix of the perturbed version of the generated graph.
ClustersLength
Length of the k
clusters.
Camille Champion, Magali Champion
l1_spectralclustering
, l1spectral
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #############################################################
# Generating toy data
#############################################################
Data <- CreateDataSet(k=3, n=20, p=list(p_inside=0.1,p_outside=0.1))
# Data is a list of three objects:
# - Data$A is an nxn matrix corresponding to the adjacency matrix of a graph
# with n nodes and k clusters,
# - Data$A_hat is a perturbed version of this graph with a probability
# p_inside of removing an edge inside clusters and
# p_outside of adding an edge between clusters,
# - Data$ClustersLength is a vector indicating the length of the clusters.
Data <- CreateDataSet(k=3, n=20, p=list(p_inside=0.1,p_outside=0.1), print.plot=TRUE)
# The same as above but the true graph and its perturbed version are both plotted.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.