leiden
Detect communities in network data using the Leiden clustering algorithm. Adjust resolution, weights, and iterations for precise clustering. Supports directed/undirected graphs and customizable parameters for accurate analysis.
Instructions
Leiden clustering algorithm for community detection
Input Schema
Name | Required | Description | Default |
---|---|---|---|
clustering_args | No | Any further arguments to pass to the clustering algorithm. | |
directed | No | Whether to treat the graph as directed or undirected. | |
flavor | No | Which package's implementation to use. | igraph |
key_added | No | `adata.obs` key under which to add the cluster labels. | leiden |
n_iterations | No | How many iterations of the Leiden clustering algorithm to perform. -1 runs until optimal clustering. | |
neighbors_key | No | Use neighbors connectivities as adjacency. If specified, leiden looks .obsp[.uns[neighbors_key]['connectivities_key']] for connectivities. | |
obsp | No | Use .obsp[obsp] as adjacency. You can't specify both `obsp` and `neighbors_key` at the same time. | |
random_state | No | Change the initialization of the optimization. | |
resolution | No | A parameter value controlling the coarseness of the clustering. Higher values lead to more clusters. | |
use_weights | No | If `True`, edge weights from the graph are used in the computation (placing more emphasis on stronger edges). |