CreateDataSet {l1spectral} | R Documentation |
Create data set
Description
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.
Usage
CreateDataSet(k, n, p, print.plot = TRUE, ClustersLength = NULL)
Arguments
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 |
Value
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 thek
clusters.
Author(s)
Camille Champion, Magali Champion
See Also
l1_spectralclustering
, l1spectral
.
Examples
#############################################################
# 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.
[Package l1spectral version 0.99.6 Index]