Sha256: 41d615a3dc68a9c72e9726680deec04d20cf37284ca249b972c94f1511803611
Contents?: true
Size: 337 Bytes
Versions: 6
Compression:
Stored size: 337 Bytes
Contents
module Semantic class Compare class << self def similarity(vector1, vector2) cosine(vector1, vector2) end def cosine(vector1, vector2) unless vector2.nil? or vector1.nil? (vector2.dot(vector1)) / (vector1.norm * vector2.norm) end end end end end
Version data entries
6 entries across 6 versions & 3 rubygems