'similarity_engine' provides feature for calculating similarity of vector such as Cosine-similarity.
- ruby >= 2.0
Add this line to your application's Gemfile:
gem 'similarity_engine', :github => 'yukihir0/similarity_engine'
And then execute:
% bundle install
vec_x = [1, 2, 3]
vec_y = [2, 4, 6]
engine = SimilarityEngine.new
similarity = engine.analyze(vec_x, vec_y)
puts similarity
For more information, please see here.
Copyright © 2013 yukihir0