This function is the main function for fitting Dlvms with greed.
In the simplest case you may only provide a dataset and greed will find a suitable one.
The accepted classes for
X depends on the generative used which can be specified with the
DlvmPrior-class and the derived classes for details.
Greed enables the clustering of networks and count data matrix with different models.
Model selection and clustering are performed in
combination by optimizing the Integrated Classification Likelihood.
Optimization is performed thanks to a combination of greedy local search and
a genetic algorithm. The main entry point is the
to perform the clustering, which is documented below. The package also
provides sampling functions for all the implemented DLVMs.
greed(X, model = find_model(X), K = 20, alg = Hybrid(), verbose = FALSE)
data to cluster either a data.frame, a matrix, an array, ... depending on the used generative model
initial number of cluster
boolean value for verbose mode
sbm <- rsbm(50, c(0.5, 0.5), diag(2) * 0.1 + 0.01) sol <- greed(sbm$x, model = Sbm()) #> #> ── Fitting a guess SBM model ── #> #> ℹ Initializing a population of 20 solutions. #> ℹ Generation 1 : best solution with an ICL of -524 and 2 clusters. #> ℹ Generation 2 : best solution with an ICL of -524 and 2 clusters. #> ── Final clustering ── #> #> ── Clustering with a SBM model 2 clusters and an ICL of -524 table(sbm$cl,clustering(sol)) #> #> 1 2 #> 1 2 19 #> 2 28 1