# Question about optimal number of clusters

**URL:** <https://discourse.julialang.org/t/question-about-optimal-number-of-clusters/45418>\
**Category:** General Usage\
**Tags:** question\
**Created:** [August 23, 2020, 2:44pm UTC](https://discourse.julialang.org/t/question-about-optimal-number-of-clusters/45418 "2020-08-23T14:44:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abcde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abcde/32/16180_2.png) [@abcde](https://discourse.julialang.org/u/abcde)\
**Post date:** [August 23, 2020, 2:44pm UTC](https://discourse.julialang.org/t/question-about-optimal-number-of-clusters/45418/1 "2020-08-23T14:44:47Z")

</div>

As is known to all, clustering is a kind of unsupervised learning method, including k-means, DBSCAN, etc., where the class number of clustering “K” needs to be set in advance.  
There are many ways to estimate the best “k”, such as BIC(Bayesian Information Criterions), SIL(Silhouette), WCSS(Within Cluster Sum of Squared), DBI(Davies Bouldin Index),elbow method, and so on.  
But I can’t find the relevant package in Julia.  
Could you recommend some related Pkg to find the optimal number of clustering classes?thanks!!!

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 23, 2020, 2:48pm UTC](https://discourse.julialang.org/t/question-about-optimal-number-of-clusters/45418/2 "2020-08-23T14:48:31Z")

</div>

[https://github.com/JuliaStats/Clustering.jl](https://github.com/JuliaStats/Clustering.jl) has some of them according to their readme

---

<div class="post-metadata">

**Author:** ![abcde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abcde/32/16180_2.png) [@abcde](https://discourse.julialang.org/u/abcde)\
**Post date:** [August 23, 2020, 3:20pm UTC](https://discourse.julialang.org/t/question-about-optimal-number-of-clusters/45418/3 "2020-08-23T15:20:36Z")

</div>

I’ve noticed this Pkg, but it doesn’t have a detailed example, and I don’t know how to input the variables in the function.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/0/6/069985459bf01528e080c5e64bd5333d52707a9f.png)

---

<div class="post-metadata">

**Author:** ![abcde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abcde/32/16180_2.png) [@abcde](https://discourse.julialang.org/u/abcde)\
**Post date:** [August 23, 2020, 3:24pm UTC](https://discourse.julialang.org/t/question-about-optimal-number-of-clusters/45418/5 "2020-08-23T15:24:02Z")

</div>

Also, I noticed that Python has a lot of these Pkg, and I tried to call Python’s Pkg, but it went wrong.

```julia
using PyCall
TS = pyimport("tslearn")

```

![image](https://global.discourse-cdn.com/julialang/original/3X/b/d/bd98b0212fbab10e6f6417dade0f0f02b2409192.png)
