Affinity propagation fit, fit_predict and predict methods I am using sklearn affinity propagation algorithm as below.

affprop = sklearn.cluster.AffinityPropagation(affinity="precomputed", damping=0.5)


I also have a similarity matrix created for the data I am using. Now I want to use my similarity matrix to use in the affinity propagation model.

In sklearn they have different methods for this such as fit, fit_predict, predict. So, I'm not sure what to use.

Is it correct if I use,

affprop.fit(my similarity matrix)
It is correct to use as you indicated.

For example, in below , I use levenshtein for make similarity matrix. then use this matrix for clustring by affinity algorithm.

lev_similarity = -1*np.array([[distance.levenshtein(w1,w2) for w1 in words]
                              for w2 in words])

af = affprop.fit(lev_similarity)