What is required in Affinity Propagation

I am hoping to use affinity propagation to cluster my data using sklearn. But I came across a question whether to use a distance matrix or similarity matrix in the fit method.

Please let me know what is suitable to use?

• Did you check the paper and the source code? – Has QUIT--Anony-Mousse Sep 19 '17 at 19:01
• I did check the source code of sklearn. However, they are inserting some random data, so it is bit difficult to understand. – Volka Sep 20 '17 at 4:51
• @Anony-Mousse Can you please tell me if you know? – Volka Sep 21 '17 at 0:58
• I'd have to read the paper. – Has QUIT--Anony-Mousse Sep 21 '17 at 6:44

According to sklearn.cluster.AP (in case in AP chosen affinity = "precomputed") the method "fit" requires X where X is matrix of similarities / affinities, that is, if distance matrix is estimated, use as:
X $$= matrix\ of\ similarities = -distance\ matrix$$.