All Projects → yoshoku → annoy.rb

yoshoku / annoy.rb

Licence: Apache-2.0 license
annoy-rb provides Ruby bindings for the Annoy (Approximate Nearest Neighbors Oh Yeah).

Programming Languages

C++
36643 projects - #6 most used programming language
ruby
36898 projects - #4 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to annoy.rb

adventures-with-ann
All the code for a series of Medium articles on Approximate Nearest Neighbors
Stars: ✭ 40 (+73.91%)
Mutual labels:  nearest-neighbor-search, approximate-nearest-neighbor-search
Annoy
Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk
Stars: ✭ 9,262 (+40169.57%)
Mutual labels:  nearest-neighbor-search, approximate-nearest-neighbor-search
pgvector
Open-source vector similarity search for Postgres
Stars: ✭ 482 (+1995.65%)
Mutual labels:  nearest-neighbor-search, approximate-nearest-neighbor-search
scikit-hubness
A Python package for hubness analysis and high-dimensional data mining
Stars: ✭ 41 (+78.26%)
Mutual labels:  nearest-neighbor-search, approximate-nearest-neighbor-search
Milvus
An open-source vector database for embedding similarity search and AI applications.
Stars: ✭ 9,015 (+39095.65%)
Mutual labels:  nearest-neighbor-search, approximate-nearest-neighbor-search
lshensemble
LSH index for approximate set containment search
Stars: ✭ 48 (+108.7%)
Mutual labels:  nearest-neighbor-search, approximate-nearest-neighbor-search
sinator
Sinatra application generator
Stars: ✭ 19 (-17.39%)
Mutual labels:  gem
make model searchable
Adds simlpe search functionality to models
Stars: ✭ 27 (+17.39%)
Mutual labels:  gem
bundle outdated formatter
Formatter for `bundle outdated` command
Stars: ✭ 16 (-30.43%)
Mutual labels:  gem
rsgem
Rootstrap way ® to generate gems
Stars: ✭ 26 (+13.04%)
Mutual labels:  gem
capybara-json
No description or website provided.
Stars: ✭ 61 (+165.22%)
Mutual labels:  gem
activerecord-shard for
Database Sharding Library for ActiveRecord
Stars: ✭ 16 (-30.43%)
Mutual labels:  gem
Rayuela.jl
Code for my PhD thesis. Library of quantization-based methods for fast similarity search in high dimensions. Presented at ECCV 18.
Stars: ✭ 54 (+134.78%)
Mutual labels:  nearest-neighbor-search
carrierwave-cloudflare
🎑 This Rails gem integrates Carrierwave with Cloudflare Image Resizing
Stars: ✭ 24 (+4.35%)
Mutual labels:  gem
nanook
Ruby library for making and receiving payments and managing a nano currency node
Stars: ✭ 17 (-26.09%)
Mutual labels:  gem
multi-tenancy-devise
mtdevise adds basecamp style user logins to your ruby on rails application.
Stars: ✭ 27 (+17.39%)
Mutual labels:  gem
modular routes
Dedicated controllers for each of your Rails route actions.
Stars: ✭ 45 (+95.65%)
Mutual labels:  gem
als typograf
Ruby client for ArtLebedevStudio.RemoteTypograf Web Service.
Stars: ✭ 15 (-34.78%)
Mutual labels:  gem
delayed job worker pool
Worker process pooling for Delayed Job
Stars: ✭ 32 (+39.13%)
Mutual labels:  gem
product-quantization
🙃Implementation of vector quantization algorithms, codes for Norm-Explicit Quantization: Improving Vector Quantization for Maximum Inner Product Search.
Stars: ✭ 40 (+73.91%)
Mutual labels:  approximate-nearest-neighbor-search

annoy-rb

Build Status Gem Version License Documentation

annoy-rb provides Ruby bindings for the Annoy (Approximate Nearest Neighbors Oh Yeah).

Installation

Add this line to your application's Gemfile:

gem 'annoy-rb'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install annoy-rb

Note: annoy-rb does not require the installation of another external library. In addition, annoy-rb does not give any optimization options when building native extensions. If necessary, add optimization options yourself during installation, as follows;

$ bundle config --local build.annoy-rb "--with-cxxflags=-march=native"
$ bundle install

Or:

$ gem install annoy-rb -- --with-cxxflags=-march=native

Documentation

Usage

require 'annoy'

f = 40 # length of item vector that will be indexed.
t = Annoy::AnnoyIndex.new(n_features: f, metric: 'angular')

1000.times do |i|
  v = Array.new(f) { rand }
  t.add_item(i, v)
end

t.build(10) # 10 trees.
t.save('test.ann')

u = Annoy::AnnoyIndex.new(n_features: f, metric: 'angular')
u.load('test.ann')
p u.get_nns_by_item(0, 100) # will find the 100 nearest neighbors.

With the default argument, annoy-rb uses double precision floating point type for the data type of vector element. On the other hand, the Python bindings of Annoy use single precision floating point type. If you want to load a search index created with the Python bindings, specify 'float32' to the dtype argument.

require 'annoy'

f = 40
t = Annoy::AnnoyIndex.new(n_features: f, metric: 'angular', dtype: 'float32')
t.load('index_with_python_bindings.ann')

License

The gem is available as open source under the terms of the Apache-2.0 License.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/annoy.rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].