Cosine distance as vector distance function for k-means

前端 未结 3 2148
暖寄归人
暖寄归人 2021-02-07 19:29

I have a graph of N vertices where each vertex represents a place. Also I have vectors, one per user, each one of N coefficients where the coefficient\'s value is the duration i

3条回答
  •  终归单人心
    2021-02-07 20:26

    Q1. Why is this assumption wrong?

    As we see from the definition, cosine similarity measures angle between 2 vectors.

    In your case, vector v1 lies flat on the first dimension, while c1 and c2 both are equally aligned from the axes, and thus, cosine similarity has to be same.

    Note that the trouble lies with c1 and c2 pointing in the same direction. Any v1 will have the same cosine similarity with both of them. For illustration :

    enter image description here

    Q2. Is the cosine distance a correct distance function for this case?

    As we see from the example in hand, probably not.

    Q3. What would be a better one given the nature of the problem?

    Consider Euclidean Distance.

提交回复
热议问题