# \#generalized-tanimoto

**URL:** https://discuss.ocaml.org/tag/generalized-tanimoto/300.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [What is the fastest way to compute the weighted Jaccard index in OCaml?](https://discuss.ocaml.org/t/what-is-the-fastest-way-to-compute-the-weighted-jaccard-index-in-ocaml/3703)

<div class="topic-metadata">

**Author:** [@UnixJunkie](https://discuss.ocaml.org/u/UnixJunkie)\
**Replies:** 15\
**Last updated:** [April 25, 2019, 6:49am UTC](https://discuss.ocaml.org/t/what-is-the-fastest-way-to-compute-the-weighted-jaccard-index-in-ocaml/3703 "2019-04-25T06:49:20Z")

</div>

Hello, What is the most efficient way to compute this: given two sparse integer vectors A and B, we want to compute: J\_w(A,B) = |AnB| / (|A| + |B| - |AnB|) With |A| being sum(a\_i); i.e. the sum of all feature counts. …
