1
$\begingroup$

I want to cluster my document vectors (doc2vec) using affinity propagation.

However, I am just confused if I should use cosine similarity or cosine distance to cluster my document vectors. Currently, I am using cosine similarity for my affinity propagation clustering. Thus, my first question is;

Is it correct to use cosine similarity to cluster my doc2vec document vectors?

Moreover, I would like to visualize my cluster results using t-sne. However, I saw that t-sne requires distance matrix as the input. Hence, my second question is;

Is it correct to use distance matrix (cosine distance) for t-sne, while I use cosine similarity for clustering?

If my code is required I can post it too.

Please help me.

$\endgroup$
1
$\begingroup$

Both of them convert the distances back to similarities, albeit using different methods. They will, if I recall correctly, also square the distances.

This may be problematic with the most common variant of cosine distance, which already is a squared distance. So it may be a good idea to modify the methods to be able to directly work with the similarities. But you probably need to modify the source code for this (and understand the methods!)

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thank you for your answer. Can you please tell me what is the standard inputs for affinity propagation and t-sne? (bacuase I do not have enough time to modify their source codes) $\endgroup$ – Smith Volka Jan 4 '18 at 11:15
  • $\begingroup$ Depends on what implementation you use. Some may accept multiple kinds of input. $\endgroup$ – Has QUIT--Anony-Mousse Jan 4 '18 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.