Jaccard index (intersection over union)

The Jaccard index–otherwise known as intersection over union–is used to calculate the similarity or difference of sample sets.

J(A,B)=|AB||AB|

0J(A,B)1

The index is defined to be 1 if the sets are empty.