elasticsearch-ruby
https://github.com/elastic/elasticsearch-ruby
Ruby
Ruby integrations for Elasticsearch
Vector#normalize
Returns a new vector with the same direction but with norm 1. v = Vector[5,8,2].normalize # => Vector[0.5184758473652127, 0.8295613557843402, 0.20739033894608505] v.norm => 1.0
Edit
git clone [email protected]:elastic/elasticsearch-ruby.git
cd elasticsearch-ruby
open
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Vector-normalize-for-pr
# Commit to gitgit add git commit -m "better docs for Vector#normalize"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Vector-normalize-for-pr
hub pull-request
# Celebrate!