Cosine distance is a term often used for the complement in positive space, that is: ${\displaystyle D_{C}(A,B)=1-S_{C}(A,B)} D_{C}(A,B)=1-S_{C}(A,B)$. It is important to note, however, that this is not a proper distance metric as it does not have the triangle inequality property and it violates the coincidence axiom; to repair the triangle inequality property while maintaining the same ordering, it is necessary to convert to angular distance (see below.) Wiki Reference

I like to get the intuition of how violating triangle inequality make it a bad metric.

  • 4
    $\begingroup$ Violating the triangle inequality doesn't make it a bad distance metric - it makes it "not a proper distance metric" at all! By definition, a metric must satisfy the triangle inequality (in addition to a few others) en.wikipedia.org/wiki/Metric_(mathematics). Whether or not its good or bad depends on your use-case. $\endgroup$ – ilanman Oct 4 '16 at 23:31
  • 1
    $\begingroup$ "Cosine distance" 1-cos is simply a squared euclidean distance (for unit-normalized vectors). Squared euclidean distance violates triangular ineqiality. See this thread stats.stackexchange.com/q/135171/3277 about "correlation distances" - almost everything said there is true for cosine similarity too. $\endgroup$ – ttnphns Oct 5 '16 at 0:52

Your Answer

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

Browse other questions tagged or ask your own question.