| fuzzyJaccard | R Documentation | 
Calculates the fuzzy Jaccard index. The "normal" Jaccard index is given by sum(A intersect B) / sum(A union B), where A and B are sets. Typically, A and B are binary outcomes, but the fuzzy version can accommodate values in [0, 1] and/or binary outcomes. The computationally efficient and equivalent method is sum(pmin(A, B)) / (sum(A) + sum(B) - sum(pmin(A, B))). If A and B and both binary, the outcome is the same as the "plain" Jaccard index.
fuzzyJaccard(a, b)
| a,b | Vectors of binary and/or values in the range [0, 1]. The vectors must be of the same length. | 
Numeric in the range [0, 1].
a <- c(0.3, 0, 0.9, 0.5)
b <- c(1, 1, 0, 0)
fuzzyJaccard(a, b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.