Similar
Similar is a library of functions to assist in determining the similarity of arbitrary sets of data.
Installation
Add this line to your application’s Gemfile:
gem 'similar'
And then execute:
$ bundle
Or install it yourself as:
$ gem install similar
Examples
a = [1, 2, 3]
b = [1, 2, 3]
Similar.pearson_score(a, b)
=> 1.0
a = [1, 2, 3]
b = [1, 2, 5.0]
Similar.pearson_score(a, b)
=> 0.9607689228305226
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request