The Jaccard index is a statistic used for gauging the similarity and diversity of sample sets. It is defined in general taking the ratio of two sizes (areas or volumes), the intersection size divided by the union size, also called intersection over union (IoU). The concept was first introduced by Grove Karl Gilbert in 1884 as the “ratio of verification” in contexts of geological prediction evaluation. and now is often called the critical success index in meteorology. It was later developed independently by Paul Jaccard, originally giving the French name coefficient de communauté (coefficient of community), and independently formulated again by Taffee Tadashi Tanimoto. Thus, it is also called Tanimoto index or Tanimoto coefficient in some fields.
Overview The Jaccard index measures similarity between finite non-empty sample sets and is defined as the size of the intersection divided by the size of the union of the sample sets:
J ( A , B ) = | A ∩ B | | A ∪ B | = | A ∩ B | | A | + | B | − | A ∩ B | . {\displaystyle J(A,B)={\frac {|A\cap B|}{|A\cup B|}}={\frac {|A\cap B|}{|A|+|B|-|A\cap B|}}.}
The Jaccard index can be interpreted as a normalized measure of overlap between two sets, where the intersection represents shared elements and the union represents the total set of distinct elements. By definition, 0 ≤ J ( A , B ) ≤ 1. {\displaystyle 0\leq J(A,B)\leq 1.} If the sets A {\displaystyle A} and B {\displaystyle B} have no elements in common, their intersection is empty, so | A ∩ B | = 0 {\displaystyle |A\cap B|=0} and therefore J ( A , B ) = 0. {\displaystyle J(A,B)=0.} The other extreme is that the two sets are equal. In that case A ∩ B = A ∪ B = A = B , {\displaystyle A\cap B=A\cup B=A=B,} so then J ( A , B ) = 1. {\displaystyle J(A,B)=1.} The Jaccard index is widely used in computer science, ecology, genomics and other sciences where binary or binarized data are used.
Both the exact solution and approximation methods are available for hypothesis testing with the Jaccard index. Jaccard similarity also applies to bags, i.e., multisets. This has a similar formula, but the symbols used represent bag intersection and bag sum (not union). The maximum value is 1/2.
J ( A , B ) = | A ∩ B | | A ⊎ B | = | A ∩ B | | A | + | B | . {\displaystyle J(A,B)={\frac {|A\cap B|}{|A\uplus B|}}={\frac {|A\cap B|}{|A|+|B|}}.}
The Jaccard distance, which measures dissimilarity between sample sets, is complementary to the Jaccard index and is obtained by subtracting the Jaccard index from 1 or, equivalently, by dividing the difference of the sizes of the union and the intersection of two sets by the size of the union:
d J ( A , B ) = 1 − J ( A , B ) = | A ∪ B | − | A ∩ B | | A ∪ B | . {\displaystyle d_{J}(A,B)=1-J(A,B)={\frac {|A\cup B|-|A\cap B|}{|A\cup B|}}.}
… excerpt ends here. Continue reading the full article.






