Jump to content

Jaccard index

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 85.2.70.27 (talk) at 22:01, 15 October 2007 (→‎References: - typos). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The Jaccard index, also known as the Jaccard similarity coefficient, is a statistic used for comparing the similarity and diversity of sample sets.

The Jaccard coefficient is defined as the size of the intersection divided by the size of the union of the sample sets:

.

The Jaccard distance, which measures dissimilarity between sample sets, is obtained by dividing the difference of the sizes of the union and the intersection of two sets by the size of the union, or, simpler, by subtracting the Jaccard coefficient from 1:

.

Similarity of Asymmetric Binary Attributes

Given two objects, A and B, each with n binary attributes, the Jaccard coefficient is a useful measure of the overlap that A and B share with their attributes. Each attribute of A and B can either be 0 or 1. The total number of each combination of attributes for both A and B are specified as follows:

represents the total number of attributes where A and B both have a value of 1.
represents the total number of attributes where the attribute of A is 0 and the attribute of B is 1.
represents the total number of attributes where the attribute of A is 1 and the attribute of B is 0.
represents the total number of attributes where A and B both have a value of 0.

Each attribute must fall into one of these four categories, meaning that

.

The Jaccard similarity coefficient, J, is given as

.

The Jaccard distance, J', is given as

.

Tanimoto Coefficient (Extended Jaccard Coefficient)

Cosine similarity is a measure of similarity between two vectors of n dimensions by finding the angle between them, often used to compare documents in text mining. Given two vectors of attributes, A and B, the cosine similarity, , is represented using a dot product and magnitude as

.

For text matching, the attribute vectors A and B are usually the Tf-idf vectors of the documents.

Since the angle, , is in the range of , the resulting similarity will yield the value of as meaning exactly opposite, meaning independent, 0 meaning exactly the same, with in-between values indicating intermediate similarities or dissimilarities.

This cosine similarity metric may be extended such that it yields the Jaccard Coefficient in the case of binary attributes. This is the Tanimoto Coefficient, , represented as

.

References

  • Pang-Ning Tan, Michael Steinbach and Vipin Kumar, Introduction to Data Mining (2005), ISBN 0-321-32136-7
  • Paul Jaccard (1901) Bulletin del la Société Vaudoise des Sciences Naturelles 37, 241-272.
  • Tanimoto, T.T. (1957) IBM Internal Report 17th Nov. 1957.

See also

External links