Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reproduce original API #2

Closed
pommedeterresautee opened this issue May 13, 2018 · 2 comments
Closed

reproduce original API #2

pommedeterresautee opened this issue May 13, 2018 · 2 comments

Comments

@pommedeterresautee
Copy link

Original API separate different steps of the creation of an index (setup, data loading, index loading OR index creation). There is also function to change parameter of search (setQueryTimeParams). Would it be possible to reproduce this API? It would be easier to reproduce the code of the original project and leverage the existing documentation.

@mlampros
Copy link
Owner

@pommedeterresautee when I created this package my primary intention was to be able to utilize an approximate k-nearest-neighbor search in big data sets ( my KernelKnn package was too slow especially if the data set consisted of more than 100.000 observations ).

To make this happen I had to structure the NMSlib R6 class in a specific order, so that the output could be used for k-nearest-neighbor queries (Knn_Query() and knn_Query_Batch() ) and also for supervised classification (KernelKnn_nmslib, KernelKnnCV_nmslib) . You can have a look at the R code of the NMSlib R6 class beginning from line 209 here. In those lines I use the createIndex , setQueryTimeParams that you already mentioned (those two correspond to Index_Params and Time_Params in the R6 class).

Probably, I could also add a function in the package that consists of

Nmslib <- reticulate::import("nmslib")

so that the user has the flexibility to access all the methods of the python Nmslib library (not in a specific order), but I guess this is not necessary as the reticulate package allows nowadays an R user to import any python module / library in R without any restrictions.

@pommedeterresautee
Copy link
Author

Working directly with reticulate is quite strange (the $ everywhere) and there is certainly space for a full wrapper but I understand what you mean. I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants