danielharan (owner)

Revisions

gist: 26772 Download_button fork
public
Public Clone URL: git://gist.github.com/26772.git
Embed All Files: show embed
Text #
1
2
3
4
5
6
class Jaccard
  def self.coefficient(a,b)
    result = (a & b).length / (a + b).uniq.length.to_f
    (result * 1000).round / 1000.0
  end
end