# Choosing a Clustering Resolution

**URL:** <https://discourse.scverse.org/t/choosing-a-clustering-resolution/1132>\
**Category:** scanpy\
**Tags:** clustering\
**Created:** [February 13, 2023, 11:43pm UTC](https://discourse.scverse.org/t/choosing-a-clustering-resolution/1132 "2023-02-13T23:43:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danamcc](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@danamcc](https://discourse.scverse.org/u/danamcc)\
**Post date:** [February 13, 2023, 11:43pm UTC](https://discourse.scverse.org/t/choosing-a-clustering-resolution/1132/1 "2023-02-13T23:43:00Z")

</div>

Hi,  
I have a large dataset where there is no ground truth to what clusters should be, so I can’t used annotation based validation. I’m having difficulty choosing an appropriate resolution when doing leiden clustering. I know that Seurat can determine clusters with a power analysis, is there anything similar in scanpy or scvi to validate the probability that clusters are distinct from each other? Otherwise I’m doing a more manual decision of calculating DEGs at different resolutions and checking if there’s enough above an LFC threshold.  
Thanks!

---

<div class="post-metadata">

**Author:** ![yotamcons](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/yotamcons/32/300_2.png) [@yotamcons](https://discourse.scverse.org/u/yotamcons)\
**Post date:** [February 17, 2023, 7:44am UTC](https://discourse.scverse.org/t/choosing-a-clustering-resolution/1132/2 "2023-02-17T07:44:27Z")

</div>

I’d love to also learn what are the standard tools for decision making for this parameter selection.

I’ve found that the dendogram tool is quite helpful:

```auto
sc.tl.leiden(adata, key_added="leiden_res0_25", resolution=0.25)
sc.tl.leiden(adata, key_added="leiden_res0_5", resolution=0.5)

sc.tl.dendrogram(adata, groupby = "leiden_res0_25")
sc.pl.dendrogram(adata, groupby = "leiden_res0_25")

sc.tl.dendrogram(adata, groupby = "leiden_res0_5")
sc.pl.dendrogram(adata, groupby = "leiden_res0_5")

```

And visualization can sometimes help guiding:

```auto
sc.pl.umap(adata, color=["leiden_res0_25", "leiden_res0_5"], legend_loc="on data")

```

generally, There are also the elbow and silhouette scores:

> **[Stop Using Elbow Method in K-means Clustering, Instead, Use this!](https://towardsdatascience.com/elbow-method-is-not-sufficient-to-find-best-k-in-k-means-clustering-fc820da0631d)**
>
> Learn how to find the number of clusters in K-means clustering
