2
$\begingroup$

I want to cluster Facebook user based on the number of mutual friends. If two users have more number of mutual friends then they are designated more closer to each other. I am thinking about using k-medoids clustering algorithm. In R I can use PAM for k-medoid clustering which needs data as a distance matrix.But How can I have mutual friend as similarity criteria? How can I convert this similarity to a distance matrix?

$\endgroup$

1 Answer 1

2
$\begingroup$

You could use any distance measure that decreases as the number of mutual friends increases. For example, \begin{equation} D = \frac{1}{m} \end{equation}where $m$ is the number of mutual friends. As $m$ increases, your distance decreases, which is what you want. Another possible measure is \begin{equation} D = e^{-m}. \end{equation} I had a spatial stats project a few years ago where I had to do something similar. I noticed that the exact distance measure didn't have much impact on the results. You can try a bunch of different distance measures and see.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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