Giter Site home page Giter Site logo

Comments (8)

eddelbuettel avatar eddelbuettel commented on May 29, 2024

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.

SamGG avatar SamGG commented on May 29, 2024

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.

eddelbuettel avatar eddelbuettel commented on May 29, 2024

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.

SamGG avatar SamGG commented on May 29, 2024

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.

eddelbuettel avatar eddelbuettel commented on May 29, 2024

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.

SamGG avatar SamGG commented on May 29, 2024

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.

eddelbuettel avatar eddelbuettel commented on May 29, 2024

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.

eddelbuettel avatar eddelbuettel commented on May 29, 2024

Closing for inactivity.

from rcppannoy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.