Sorensen-Dice Coefficient

Decision Sciences
Introduced by
Thorvald Sorensen and Lee Dice
Year
1945
Type
Binary and compositional similarity measure
Family
Set similarity and presence-absence index

What does it do?

The Sorensen-Dice coefficient, also called the Dice coefficient, measures the similarity of two sets of attributes, such as the species present in two ecological samples.

It runs from 0 (no shared attributes) to 1 (identical sets). Lee R. Dice described the measure for quantifying ecological association between species in 1945. It is designed for presence-absence data; for abundances, a weighted variant or Bray-Curtis is more appropriate.

The intuition behind the method

Take two ecological samples, each with a list of the species it contains. The coefficient counts the species found in both samples and divides twice that count by the total number of species listed across the two samples. Shared species count twice in the denominator, so the index rewards overlap relative to the combined size of both lists. Samples that share most of their species score close to 1, and samples with little overlap score close to 0. Species absent from both samples play no role in the calculation. Swapping the two samples gives the same value, so the index is symmetric.

History

Lee R. Dice described the measure in 1945 as a way to quantify the amount of ecological association between species, in a paper published in Ecology. The same calculation later entered text analysis, document retrieval and machine learning, where it appears as the F1 score in classification contexts.

When to use it

Choose Sorensen-Dice when the data are binary presence-absence records, such as species lists, word sets or sets of discrete features, and the question is how much two sets overlap. It is also a reasonable choice when joint absences carry no information, as is often the case for sparse data in which most attributes are missing from most observations. When one set holds predicted labels and the other holds true labels, it gives the same value as the F1 score, so it suits comparisons of label sets. Do not use the binary form on abundance or count data where magnitudes matter; use a weighted variant or Bray-Curtis instead. Do not use it when an algorithm requires a true metric, or when the presence threshold cannot be justified, because the results depend on that threshold.

Limitations and considerations

  • Not a true metric: it does not satisfy the triangle inequality, so it is unsuitable where metric properties are required.
  • Designed for binary sets; continuous or count data must first be converted to presence-absence by a threshold, and the result depends on that threshold.
  • Does not weight attributes by importance; every shared attribute contributes equally.
  • Ignores joint absences, which can be informative in some designs, for example when two sites both lack a species because of a shared constraint.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Symmetric: swapping the two sets leaves the value unchanged.
  • Ignores joint absences, so attributes missing from both observations do not raise the similarity; this suits sparse data where absence is uninformative.
  • Bounded between 0 and 1, and a monotone function of the Jaccard index (S = 2J/(1+J)), so it ranks pairs in the same order as Jaccard.
  • Equivalent to the F1 score when comparing predicted and true label sets, which links its ecological and classification uses.

Applications

  • Ecological community comparison: assessing species composition similarity between habitats or time periods
  • Text mining and document similarity: comparing word presence across documents or corpus segments
  • Medical image segmentation evaluation: measuring pixel overlap between a predicted region and the ground truth, reported as the Dice coefficient
  • Record linkage and entity matching: determining match likelihood based on shared identifiers or attributes
  • Clustering and classification: measuring set similarity for grouping observations with similar attribute profiles

How it works

How it works

1

For each attribute (species, word, feature), record whether it is present or absent in each of the two observations.

2

Count the attributes present in both observations (the intersection size, written |A∩B|) and the number of attributes present in each observation (|A| and |B|). Attributes absent from both are not counted.

3

Calculate S = 2|A∩B| / (|A| + |B|). The result is 1 when the two sets are identical and 0 when they share no attributes.

Common pitfalls

  • Confusing it with Jaccard: both reward shared attributes, but for any pair with partial overlap Sorensen-Dice gives a larger value, because it doubles the shared count in the numerator and uses the sum of the two set sizes as the denominator.
  • Applying the binary form to abundance data: counts are collapsed to presence and magnitude is lost; use a weighted variant or Bray-Curtis.
  • Reading a high value as a perfect match: a score of 0.9 still means the sets differ in some attributes, and those unshared attributes remain.
  • Using it as a distance in methods that assume the triangle inequality, which it does not guarantee.
  • Choosing the presence threshold arbitrarily; different thresholds can change which pairs appear most similar.

Frequently asked questions

How does Sorensen-Dice differ from Jaccard similarity?

Both measure the overlap of two sets. Jaccard divides the shared count by the size of the union; Sorensen-Dice doubles the shared count and divides by the sum of the two set sizes. For identical sets both equal 1. For a pair with partial overlap, Sorensen-Dice gives the larger value, so it is the less strict of the two.

Can Sorensen-Dice be used with weighted or abundance data?

Yes. A weighted form takes the sum of the smaller abundance of each attribute as the overlap, and divides twice that sum by the sum of the totals of the two samples. It is closely related to Bray-Curtis similarity and is the natural choice when abundance matters, not just presence or absence.

What is the relationship between Sorensen-Dice and F1 score?

When one set holds predicted labels and the other holds true labels, the Sorensen-Dice value equals the F1 score, the harmonic mean of precision and recall. The two names describe the same calculation in different fields.

When should I use Sorensen-Dice over Bray-Curtis?

Use Sorensen-Dice for binary presence-absence data or when only overlap matters. Use Bray-Curtis when abundances or counts are compared and differences in magnitude should count. Bray-Curtis is a dissimilarity, so one minus Bray-Curtis is a similarity; Sorensen-Dice is already a similarity.

Related methods

Sources

  1. Sorensen, T. (1948). A method of establishing groups of equal amplitude in plant sociology based on similarity of species content and its application to analyses of the vegetation on Danish commons. Biologiske Skrifter, 5, 1-34.

    Open publication reference
  2. Dice, L. R. (1945). Measures of the amount of ecologic association between species. Ecology, 26(3), 297-302.

    Open DOI reference
  3. 1611.08555v1, p. 271