Skip to content

Jaccard index

simJaccard(x,y)=xyxy=xyx+yxysim_{Jaccard}(x,y) = {{|x \cap y|}\over{|x \cup y|}} = {{|x \cap y|}\over{|x| + |y| - |x \cap y|}}

Algorithms

Time complexitySpace complexity
Naive solution1O(n)O(n)O(n)O(n)

Footnotes

  1. string2string: A Modern Python Library for String-to-String Algorithms