PyANN

Release Version PyPI version PyPI - Downloads Build Status Windows Build Status Documentation Status

Finds the k nearest neighbours for every point in a given dataset in \(O(N \log {N})\) time using Arya and Mount's ANN library (v1.1.3). There is support for approximate as well as exact searches, fixed radius searches and bd as well as kd trees.

This package implements nearest neighbors for the Euclidean (L2) metric.

For further details on the underlying ANN library, see http://www.cs.umd.edu/~mount/ANN.

PyANN was written to be the Python equivalent of the R package RANN. For further details on the R implementation, see RANN.

Requirements

Python Version

PyANN requires Python>=3.6 due to the use of type annotations in the source code, which was implemented in Python 3.6.

Dependencies

Installation

PyPI

The recommendation is to install the latest released version from PyPI by doing:

pip install pyann

Source

macosx / linux

To install PyANN from source you need Cython and setuptools >=18.0 in addition to the normal dependencies above. Cython can be installed from PyPI:

pip install cython

In the PyANN directory (same one where you found this file after cloning the git repo), first execute:

make

then:

python setup.py install

windows

Requires - MinGW - Visual Studio - Python Tools for Visual Studio

Install g++, gcc, and mingw32-make

mingw-get install gcc g++ mingw32-make

Install all required dependencies using pip:

"%PYTHONPATH%/python.exe" -m pip install --upgrade setuptools cython numpy pandas

where %PYTHONPATH% is the path to your python.exe.

In the PyANN directory (same one where you found this file after cloning the git repo), first execute:

cd pyann\annlib\lib
%MAKE%

where %MAKE% is the path to your mingw32-make.exe

then:

cd C:\projects\pyann
"%PYTHONPATH%/python.exe" -m pip install .

Feedback

Please feel free to:

see COPYRIGHT and LICENSE files for copyright and license information.