Trisha Shetty (Editor)

Sørensen–Dice coefficient

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

The Sørensen–Dice index, also known by other names (see Name, below), is a statistic used for comparing the similarity of two samples. It was independently developed by the botanists Thorvald Sørensen and Lee Raymond Dice, who published in 1948 and 1945 respectively. The Sørensen–Dice is also known as F1 score or Dice similarity coefficient (DSC).

Contents

Name

The index is known by several other names, especially the Sørensen index or Dice's coefficient. Other variations include the "similarity coefficient" or "index". Common alternate spellings for Sørensen are Sorenson, Soerenson and Sörenson, and all three can also be seen with the –sen ending.

Other names include:

  • Czekanowski's binary (non-quantitative) index
  • Formula

    Sørensen's original formula was intended to be applied to presence/absence data, and is

    Q S = 2 | X Y | | X | + | Y |

    where |X| and |Y| are the numbers of elements in the two samples. Based on what is written here,

    D S C = 2 T P 2 T P + F P + F N ,

    as compared with the Jaccard index, which omits true negatives from both the numerator and the denominator. QS is the quotient of similarity and ranges between 0 and 1. It can be viewed as a similarity measure over sets.

    Similarly to the Jaccard index, the set operations can be expressed in terms of vector operations over binary vectors A and B:

    s v = 2 | A B | | A | 2 + | B | 2

    which gives the same outcome over binary vectors and also gives a more general similarity metric over vectors in general terms.

    For sets X and Y of keywords used in information retrieval, the coefficient may be defined as twice the shared information (intersection) over the sum of cardinalities :

    When taken as a string similarity measure, the coefficient may be calculated for two strings, x and y using bigrams as follows:

    s = 2 n t n x + n y

    where nt is the number of character bigrams found in both strings, nx is the number of bigrams in string x and ny is the number of bigrams in string y. For example, to calculate the similarity between:

    night nacht

    We would find the set of bigrams in each word:

    {ni,ig,gh,ht} {na,ac,ch,ht}

    Each set has four elements, and the intersection of these two sets has only one element: ht.

    Inserting these numbers into the formula, we calculate, s = (2 · 1) / (4 + 4) = 0.25.

    Difference from Jaccard

    This coefficient is not very different in form from the Jaccard index. However, since it doesn't satisfy the triangle inequality, it can be considered a semimetric version of the Jaccard index.

    The function ranges between zero and one, like Jaccard. Unlike Jaccard, the corresponding difference function

    d = 1 2 | X Y | | X | + | Y |

    is not a proper distance metric as it does not possess the property of triangle inequality. The simplest counterexample of this is given by the three sets {a}, {b}, and {a,b}, the distance between the first two being 1, and the difference between the third and each of the others being one-third. To satisfy the triangle inequality, the sum of any two of these three sides must be greater than or equal to the remaining side. However, the distance between {a} and {a,b} plus the distance between {b} and {a,b} equals 2/3 and is therefore less than the distance between {a} and {b} which is 1.

    Applications

    The Sørensen–Dice coefficient is useful for ecological community data (e.g. Looman & Campbell, 1960). Justification for its use is primarily empirical rather than theoretical (although it can be justified theoretically as the intersection of two fuzzy sets). As compared to Euclidean distance, the Sørensen distance retains sensitivity in more heterogeneous data sets and gives less weight to outliers. Recently the Dice score (and its variations, e.g. logDice taking a logarithm of it) has become popular in computer lexicography for measuring the lexical association score of two given words. It is also commonly used in image segmentation, in particular for comparing algorithm output against reference masks in medical applications

    Abundance version

    The expression is easily extended to abundance instead of presence/absence of species. This quantitative version is known by several names:

  • Quantitative Sørensen–Dice index
  • Quantitative Sørensen index
  • Quantitative Dice index
  • Bray–Curtis similarity (1 minus the Bray-Curtis dissimilarity)
  • Czekanowski's quantitative index
  • Steinhaus index
  • Pielou's percentage similarity
  • 1 minus the Hellinger distance
  • References

    Sørensen–Dice coefficient Wikipedia