dynamo.tl.louvain(adata, resolution=1.0, use_weight=True, adj_matrix=None, adj_matrix_key=None, randomize=False, result_key=None, layer=None, obsm_key=None, selected_cluster_subset=None, selected_cell_subset=None, directed=False, copy=False, **kwargs)[source]

Louvain implementation from cdlib. For other community detection general parameters, please refer to dynamo's cluster_community() function. “Louvain maximizes a modularity score for each community. The algorithm optimises the modularity in two elementary phases: (1) local moving of nodes; (2) aggregation of the network. In the local moving phase, individual nodes are moved to the community that yields the largest increase in the quality function. In the aggregation phase, an aggregate network is created based on the partition obtained in the local moving phase. Each community in this partition becomes a node in the aggregate network. The two phases are repeated until the quality function cannot be increased further.” - cdlib

  • resolution (float, optional) – change the size of the communities, default to 1.

  • randomize (bool, optional) – “randomState instance or None, optional (default=None). If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.” - cdlib

Return type