Comments (8)
Could you be more explicit what exactly is lacking for your use cases? Maybe via examples from the other two packages?
In a nutshell, providing the Python API has served us well so far.
from rcppannoy.
Here is what I like in the other packages.
The RANN2 package provides a unique nn2 function
https://github.com/jefferislab/RANN/blob/master/R/nn.R
nn2 <- function(data, query=data, k=min(10,nrow(data)), ...) {
# ... being specific parameters that apply to the algorithm
# computation here
return(list(nn.idx=nn.indexes, nn.dists=nn.dist))
}
The RcppHNSW package provides a all-in-one function like RANN2, but also a function for each of the two stages, which I like.
https://github.com/jlmelville/rcpphnsw/blob/master/R/hnsw.R
#' Find Nearest Neighbors and Distances
hnsw_knn <- function(X, k = 10, distance = "euclidean", ...) {
# calls build
# calls search and returns its result
}
#' Build an hnswlib nearest neighbor index
hnsw_build <- function(X, distance = "euclidean", ...) {
# builds and returns the index
}
#' Search an hnswlib nearest neighbor index
hnsw_search <- function(X, ann, k, ...) {
# Search and returns a list
list(idx = idx, dist = dist)
}
@jlmelville did a wrapper for RcppAnnoy in the spirit on the previous functions.
https://github.com/jlmelville/uwot/blob/master/R/neighbors.R
IMHO, these functions are ease the use and the switch between packages.
I hope I elaborated enough to catch my point. Let me know.
Best.
from rcppannoy.
Well, it seems may be best qualified to propose and implement such a change in a pull request I could consider here. That is how open source often works -- I have a number of other projects to look after and will not, in the immediate future, have time to implement a feature only you know best on demand for you.
from rcppannoy.
Thanks for your reply and considering this proposal. I will do it, but not in the next two weeks. I will copy/paste a lot of work of @jlmelville unless he has time do it better than I.
Best.
from rcppannoy.
Can you not just use the interface he provided if that is what you want?
I have to be frank here: You still have not explained your issue very well, you just keep handwaving and pointing at other repos.
from rcppannoy.
His code is not exported and using it would imply to install and load uwot library.
My aim is to simplify and spread the use of RcppAnnoy by giving functions that are similar to those found in other packages. No revolution. Simplicity and minimalism.
To give a complete figure, @LTLA also provides a package for the BioConductor infra-structure. https://github.com/LTLA/BiocNeighbors
I will implement my proposal for my own use and let you know when it's ready.
Take time and let me know you decide.
Best.
from rcppannoy.
Yes I am of course aware of all those packages as they are known and listed reverse dependencies of the CRAN package.
But yes, maybe start with something simple and minimal, and it may make sense to add it here.
from rcppannoy.
Closing for inactivity.
from rcppannoy.
Related Issues (20)
- Vignette build on windows errors HOT 17
- Warning during compilation with Ropen HOT 5
- Expose `set_seed` method HOT 4
- More granular documentation HOT 5
- error installing rcppannoy on Mac 10.9.5, R 3.4.4 HOT 3
- Error in loading RcppAnnoy HOT 2
- RcppAnnoy fails to compile HOT 4
- Error during compilation of RcppAnnoy HOT 9
- rcppannoy loading/installation error HOT 6
- New / remaining sanitizer issues HOT 17
- Version 0.0.15 broke BiocNeighbors HOT 7
- 0.0.16 build from source issues on macOS HOT 5
- Vignette update HOT 9
- More content for RcppAnnoy.h HOT 4
- Unable to Save HOT 3
- Pass the whole matrix to addItem and getNNs function HOT 6
- Multithreading HOT 7
- R CMD build issue on Windows with R 4.2 HOT 9
- Run reverse depends checks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcppannoy.