Jaccard index: Difference between revisions
Content deleted Content added
m Add whitespace to separate Wikipedia template from task description |
JsfasdF256 (talk | contribs) No edit summary |
||
Line 5:
The '''Jaccard index''', also known as the '''Jaccard similarity coefficient''', is a statistic used for gauging the similarity and diversity of sample sets. It was developed by Paul Jaccard, originally giving the French name ''coefficient de communauté'', and independently formulated again by T. Tanimoto. Thus, the '''Tanimoto index''' or '''Tanimoto coefficient''' are also used in some fields. However, they are identical in generally taking the ratio of '''Intersection over Union'''. The Jaccard coefficient measures similarity between finite 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|
Define sets as follows, using any linear data structure:
<pre>
A = {}
B = {1, 2, 3, 4, 5}
C = {1, 3, 5, 7, 9}
D = {2, 4, 6, 8, 10}
E = {2, 3, 5, 7}
F = {8}
</pre>
Write a program that computes the Jaccard index for every pairing of these sets.
<br><br>
=={{header|Wren}}==
|