SkillAgentSearch skills...

NmslibR

Non Metric Space ( Approximate ) Library in R

Install / Use

/learn @mlampros/NmslibR
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

tic codecov.io CRAN_Status_Badge Downloads <a href="https://www.buymeacoffee.com/VY0x8snyh" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" height="21px" ></a> Dependencies

nmslibR (Non Metric Space Library in R)

<br>

The nmslibR package is a wrapper of the Non-Metric Space Library (NMSLIB) python package. More details on the functionality of the nmslibR package can be found in the blog-post and in the package Documentation.

<br>

Reference:

https://github.com/nmslib/nmslib

https://github.com/nmslib/nmslib/blob/master/manual/latex/manual.pdf

<br>

System Requirements

<br>
  • Python (>= 2.7)
<br>

All modules should be installed in the default python configuration (the configuration that the R-session displays as default), otherwise errors will occur during the nmslibR package installation (reticulate::py_discover_config() might be useful here).

<br>

The installation notes for Linux, Macintosh, Windows are based on Python 3.

<br>

Debian/Ubuntu

<br>

Installation of the system requirements,

<br>

sudo apt-get install python3-pip

sudo pip3 install --upgrade setuptools

sudo pip3 install -U numpy

sudo pip3 install --upgrade scipy

sudo apt-get install libboost-all-dev libgsl0-dev libeigen3-dev

sudo apt-get install cmake

pip3 install --upgrade pybind11

sudo pip3 install nmslib

<br>

Fedora

<br>

Installation of the system requirements,

<br>

dnf install python3-pip

sudo pip3 install --upgrade setuptools

sudo pip3 install -U numpy

sudo pip3 install --upgrade scipy

yum install python3-devel

yum install boost-devel

yum install gsl-devel

yum install eigen3-devel

pip3 install --upgrade pybind11

sudo pip3 install nmslib

<br>

Macintosh OSX

<br>

Upgrade python to version 3 using,


brew upgrade python

<br>

Install the requirements,

<br>

sudo pip3 install --upgrade pip setuptools wheel

sudo pip3 install -U numpy

sudo pip3 install --upgrade scipy

brew install boost

brew install eigen

brew install gsl

brew install cmake

brew link --overwrite cmake

pip3 install --upgrade pybind11

sudo pip3 install nmslib

<br>

After a successful installation of the requirements the user should open an R session and give the following reticulate command to change to the relevant (brew-python) directory (otherwise the nmslibR package won't work properly),

<br>

reticulate::use_python('/usr/local/bin/python3')


<br>

and then,

<br>

reticulate::py_discover_config()


<br>

to validate that a user is in the python version where nmslibR is installed.

<br><br>

Windows OS (the instructions were tested with the version 1.0.0 of the R package, thus use with caution)

<br>

First download of get-pip.py for windows

<br>

Update the Environment variables ( Control Panel >> System and Security >> System >> Advanced system settings >> Environment variables >> System variables >> Path >> Edit ) by adding ( for instance in case of python 2.7 ),

<br>

C:\Python36;C:\Python36\Scripts


<br>

Install the Build Tools for Visual Studio

<br>

Open the Command prompt (console) and install / upgrade the system requirements,

<br>

pip3 install --upgrade pip setuptools wheel

pip3 install -U numpy

pip3 install --upgrade scipy

<br>

Installation of cmake

<br>

First download cmake for Windows, win64-x64 Installer. Once the file is downloaded run the .exe file and during installation make sure to add CMake to the system PATH for all users.

<br>

Then install the nmslib library,

<br>

pip3 install --upgrade pybind11

pip3 install nmslib

<br>

Installation of the nmslibR package

<br>

To install the package from CRAN use,

<br>

install.packages('nmslibR')


<br>

and to download the latest version from Github use the install_github function of the remotes package, <br><br>


remotes::install_github(repo = 'mlampros/nmslibR')

<br> Use the following link to report bugs/issues, <br><br>

https://github.com/mlampros/nmslibR/issues

<br>

Citation:

If you use the code of this repository in your paper or research please cite both nmslibR and the original articles / software https://CRAN.R-project.org/package=nmslibR/citation.html:

<br>
@Manual{,
  title = {{nmslibR}: Non Metric Space (Approximate) Library in R},
  author = {Lampros Mouselimis},
  year = {2021},
  note = {R package version 1.0.7},
  url = {https://CRAN.R-project.org/package=nmslibR},
}
<br>

Related Skills

View on GitHub
GitHub Stars12
CategoryDevelopment
Updated3y ago
Forks4

Languages

R

Security Score

65/100

Audited on Feb 14, 2023

No findings