How do I convert between a measure of similarity and a measure of difference (distance)?

前端 未结 8 1815
悲&欢浪女
悲&欢浪女 2021-02-02 01:57

Is there a general way to convert between a measure of similarity and a measure of distance?

Consider a similarity measure like the number of 2-grams that two strings ha

8条回答
  •  情深已故
    2021-02-02 02:31

    If your similarity measure (s) is between 0 and 1, you can use one of these:

    1-s
    sqrt(1-s)
    -log(s)
    (1/s)-1
    

提交回复
热议问题