-1

I am checking a little about affinity propagation (apart from the packages that exist and are very useful).

After various calculations I concluded into 4 certain exemplars for a certain pair of values that are like df[1:10, ]:

   X3.115997 X1.873875
1   4.446356  2.931754
2   4.071908  2.810298
3   4.512401  2.505570
4   3.793507  3.615971
5   4.141959  3.362119
6   3.656110  3.248274
7   4.194451  2.346595
8   3.775412  2.823766
9   3.724534  2.931452
10  4.040321  3.414879

What I would like to do, is to cluster all the values of df into 4 certain values that will work as exemplars.

Stathis G.
  • 145
  • 2
  • 11

2 Answers2

0

Affinity Propagation is pretty complex and expensive.

The proper way to assign points to clusters is to iteratively compute the responsibilities, which depend on the neighbors responsibilities. But then your chosen 4 exemplars may no longer be responsible for all the data, or not the most responsible points.

Some tools such as sklearn will assign all points to the nearest neighbor when you call "predict". This is not consistent with the original approach, but in practise does not seem to make much of a difference. This may explain why affinity propagation does not appear to work much better than k-means or k-medoids in most cases - if responsibility is almost the same as closeness then they most yield the almost same result.

Hence AP is not a method that I would recommend to use - too slow for something that isn't much different to k-means in result.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
0

Thank you a lot for the answers,

Actually, what I would like to do is to cluster all the values in 4 groups (as I had concluded in 4 exemplars while applying ap clustering) in order to be able to "compare" my ap output with a clustered dataset produced in a different methodology.

The answer was much simpler, as there are various other functions like kmeans() that can do the trick. It wasn't really obvious for me in the beginning and maybe i hadn't phrase it correctly.

Stathis G.
  • 145
  • 2
  • 11