Skip to contents

Extract the best partition from the list of model given by the functions clusterize_networks() or clusterize_bipartite_networks().

Usage

extract_best_partition(l, unnest = TRUE)

Arguments

l

A list of models obtained from the function clusterize_networks()

unnest

A boolean specifying if the returned object should be un-nested (and thus loose exploration clustering structure) or not. Default to TRUE.

Value

A list of models giving the best partition.

Examples


#' # Trivial example with Gnp networks:
Net <- lapply(
  list(.7, .7, .2, .2),
  function(p) {
    A <- matrix(0, 15, 15)
    A[lower.tri(A)][sample(15 * 14 / 2, size = round(p * 15 * 14 / 2))] <- 1
    A <- A + t(A)
  }
)
if (FALSE) { # \dontrun{
cl <- clusterize_networks(Net,
  colsbm_model = "iid",
  directed = FALSE,
  distribution = "bernoulli",
  nb_run = 1
)
best_partition <- extract_best_partition(cl)
} # }