machinelearning icon indicating copy to clipboard operation
machinelearning copied to clipboard

[Clustering] Create/Add an additional trainer for Clustering: Affinity Propagation

Open CESARDELATORRE opened this issue 5 years ago • 4 comments

In ML.NET we currently only have the KMeansTrainer.

The main challenge with that clustering trainer is that you need to provide the number of clusters to use (numberOfClusters param also known as k), and that's a very difficult number to figure out. THere are methods that can help, like the Elbow method, but still it is a challenge.

There are other clustering algorithms that doesn’t require in input the number of expected clusters like the Affinity Propagation algorithm. It is relatively new (Presented in 2007) and it works by measuring the affinity between data items.

Further info about it: https://towardsdatascience.com/unsupervised-machine-learning-affinity-propagation-algorithm-explained-d1fef85f22c8

The function that measures affinity between data items is one of the hyperparameters of the algorithm.

Affinity Propagation is an unsupervised machine learning algorithm that is particularly well suited for problems where we don’t know the optimal number of clusters.

As an additional note, consider that K-means was first proposed for application in the field of statistics back in 1955.

I suggest that, when possible, we implement and offer this additional clustering algorithm, especially when we currently just have one algorithm for Clustering (KMeansTrainer).

CESARDELATORRE avatar Sep 06 '19 04:09 CESARDELATORRE

I would also recommend the OPTICS algorithm. We have code for the OPTICS algorithm brought in by @xadupre. This could be integrated in to ML.NET.

justinormont avatar Sep 10 '19 21:09 justinormont

Any news in unsupervised algorithms in ML.NET?

dawidwekwejt avatar Nov 28 '20 22:11 dawidwekwejt

Hi,

Is there a possibility of adding more clustering trainers?

Specifically, I'm interested in Affinity Propagation.

Are there any plans for this? Would a pull request be welcome?

r-Larch avatar Feb 20 '24 16:02 r-Larch

https://github.com/chriskhalil/Affinity-Propagation-Clustring/blob/master/AffinityPropagation.cs If this implementation is good enough we could make a PR that is based on it. P.S. I'm not in the ML field so I don't know how to test it.

iSeiryu avatar May 18 '24 22:05 iSeiryu