# \[ANN\] UnsupervisedClustering.jl, a unified interface for clustering with optimization techniques

**URL:** https://discourse.julialang.org/t/ann-unsupervisedclustering-jl-a-unified-interface-for-clustering-with-optimization-techniques/132720
**Category:** Package Announcements
**Tags:** cluster, optimization, clustering, regularization
**Created:** [September 27, 2025, 9:57pm UTC](https://discourse.julialang.org/t/ann-unsupervisedclustering-jl-a-unified-interface-for-clustering-with-optimization-techniques/132720 "2025-09-27T21:57:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![raphasampaio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raphasampaio/32/218602_2.png) [@raphasampaio](https://discourse.julialang.org/u/raphasampaio)
#### Post date: [September 27, 2025, 9:57pm UTC](https://discourse.julialang.org/t/ann-unsupervisedclustering-jl-a-unified-interface-for-clustering-with-optimization-techniques/132720/1 "2025-09-27T21:57:34Z")

</div>

I’m happy to announce [UnsupervisedClustering.jl](https://github.com/raphasampaio/UnsupervisedClustering.jl), a Julia package that provides a consistent interface for unsupervised clustering algorithms, along with strategies to escape local optima and reduce overfitting.

UnsupervisedClustering.jl is not a new package, but it was not previously announced here. It was developed during my master’s thesis research, where we explored [regularization](https://github.com/raphasampaio/RegularizedCovarianceMatrices.jl) and optimization techniques in model-based clustering. The study resulted in a [published paper](https://arxiv.org/abs/2302.02450) that introduces novel approaches to improve clustering quality and robustness.

This package has also been used in production at [PSR](https://github.com/psrenergy), an energy company and contributor to the JuMP ecosystem.

One of the main advantages of UnsupervisedClustering.jl is its consistent interface across all clustering methods.

```julia
# local search algorithms
kmeans = Kmeans()

# metaheuristic algorithms
genetic = GeneticAlgorithm(local_search = kmeans)
multi_start = MultiStart(local_search = kmeans)
random_swap = RandomSwap(local_search = kmeans)

# use the fit function
result1 = fit(kmeans, data, k)
result2 = fit(genetic, data, k)
result3 = fit(multi_start, data, k)

```

The unified interface enables some compositions:

```julia
kmeans = Kmeans()

estimator = UnsupervisedClustering.RegularizedCovarianceMatrices.EmpiricalCovarianceMatrix(n, d)
gmm = GMM(estimator = estimator)

# Chain algorithms together
chain = ClusteringChain(kmeans, gmm)

result = fit(chain, data, k)

```
