Reputation: 13
I have read the book of Programming Collective Intelligence. For the after-class exercise 1 of chapter 2, could someone please tell me how to calculate the tanimoto coefficient? A specific mathematical formula will be really appreciated.
Upvotes: 0
Views: 148
Reputation: 523
An extensive search on a related question has given me two formulas:
T(a,b) = N_intersection / (N_a + N_b - N_intersection) found here, which is the same as on Wikipedia in a slightly more readable fashion. EDIT: As per your comment, this is the one the OP was looking for.
(n_11+n_00) / [n_11+2(n_10+n_01)+n_00], where
For the source of the second equation have a look at http://reference.wolfram.com/language/ref/RogersTanimotoDissimilarity.html and calculate the similarity index from the dissimilarity index as (1-dissimilarity).
I believe that the second formula is commonly used in applied statistics and applied marketing.
Upvotes: 1