Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

The ANN module provides a numpy-compatible python wrapper around the Approximate Nearest Neighbor library.

The Approximate Nearest Neighbor library is available from http://www.cs.umd.edu/~mount/ANN/.

* Installation *
Download and build the Approximate Nearest Neighbor library. Modify the ANN section of site.cfg so that ANN_ROOT is the path to the root of the Approximate Nearest Neighbor library include/lib tree.
If /usr/local/include contains the ANN/ include directory and /usr/local/lib contains libANN.a, then
ANN_ROOT = /usr/local

Run ::

python setup.py build_ext --inplace build test
sudo python setup.py install

from within the source directory.

* Usage *
scikits.ann exposes a single class, kdtree that wraps the Approximate Nearest Neighbor library's kd-tree implementation. kdtree has a single (non-constructor) method, knn that finds the indecies (of the points used to construct the kdtree) of the k-nearest neighbors and the squared distances to those points. A little example will probably be much more enlightening::
>>> import scikits.ann as ann

>>> import numpy as np

>>> k=ann.kdtree(np.array([[0.,0],[1,0],[1.5,2]]))

>>> k.knn([0,.2],1)
(array([[0]]), array([[ 0.04]]))

>>> k.knn([0,.2],2)
(array([[0, 1]]), array([[ 0.04, 1.04]]))

>>> k.knn([[0,.2],[.1,2],[3,1],[0,0]],2)
(array([[0, 1],
[2, 0],
[2, 1],
[1, 2]]), array([[ 0.04, 1.04],
[ 1.96, 4.01],
[ 3.25, 5. ],
[ 1. , 6.25]]))

>>> k.knn([[0,.2],[.1,2],[3,1],[0,0]],3)
(array([[ 0, 1, 2],
[ 2, 0, 1],
[ 2, 1, 0],
[ 1, 2, -1]]), array([[ 4.00000000e-002, 1.04000000e+000, 5.49000000e+000],
[ 1.96000000e+000, 4.01000000e+000, 4.81000000e+000],
[ 3.25000000e+000, 5.00000000e+000, 1.00000000e+001],
[ 1.00000000e+000, 6.25000000e+000, 1.79769313e+308]]))

Metadata

Release files for scikits.ann 0.2.dev-r801

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scikits.ann 0.2.dev-r801
File Size Uploaded Provenance
scikits.ann-0.2.dev-r801.tar.gz 20.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for scikits.ann 0.2.dev-r801
File Interpreter ABI Platform
scikits.ann-0.2.dev_r801-py2.5-macosx-10.5-i386.egg Legacy Egg format - - Details

Total release size: 104.6 kB

Release files / scikits.ann-0.2.dev-r801.tar.gz

Download URL scikits.ann-0.2.dev-r801.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
db7c9c4f0330e9acfaf942b4ecb10921474745578e4cad477c72daf234373a19
BLAKE2b-256 checksum
How to use checksums
564f764329c009e86599e28cf937c10e8c7d71f5e05ae8ff93440be06e2ad91b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / scikits.ann-0.2.dev_r801-py2.5-macosx-10.5-i386.egg

Download URL scikits.ann-0.2.dev_r801-py2.5-macosx-10.5-i386.egg
Size 84.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
6ec616768d048425be955c578a8db47e7c5293ac158bc99da190871855b275fb
BLAKE2b-256 checksum
How to use checksums
23c32f1a9ba969420d03f4b0ce9e78cc63b5ab20146f42e563577cd890dc7b0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for scikits.ann 0.2.dev-r801

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page