Skip to content

Instantly share code, notes, and snippets.

@danielharan
Created November 19, 2008 22:22
Show Gist options
  • Save danielharan/26772 to your computer and use it in GitHub Desktop.
Save danielharan/26772 to your computer and use it in GitHub Desktop.
class Jaccard
def self.coefficient(a,b)
result = (a & b).length / (a + b).uniq.length.to_f
(result * 1000).round / 1000.0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment