# 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)

• For people who downvote please tell me what's wrong in this question – Smith Volka Aug 26 '17 at 13:36

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