Skip to main content

Cover tree implementation for computing nearest neighbors in general metric spaces.

Project description

Cover Tree

This is a Python implementation of cover trees, a data structure for finding nearest neighbors in a general metric space (e.g., a 3D box with periodic boundary conditions).

Updated for Python 3.7 from Patrick Varilly's code.

The implementation here owes a great deal to PyCoverTree, by Thomas Kollar, Nil Geisweiller, Emanuele Olivetti.

The API follows that of Anne M. Archibald's KD-tree implementation for scipy; the default metric has been set to euclidean distance, so the CoverTree class can be used exactly as a drop in replacement for scipy.spatial.KDTree.

References

Cover trees are described in two papers, for which PDF copies are included in the references directory:

A. Beygelzimer, S. Kakade, & J. Langford (2006) Cover Trees for Nearest Neighbor, 23rd International Conference on Machine Learning

D. R. Karger & M. Ruhl (2002) Finding Nearest Neighbors in Growth-restricted Metrics, 34th Symposium on the Theory of Computing.

(both originate from this page)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

covertree-1.0.0.tar.gz (12.0 kB view details)

Uploaded Source

File details

Details for the file covertree-1.0.0.tar.gz.

File metadata

  • Download URL: covertree-1.0.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.13

File hashes

Hashes for covertree-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6e5c8bbaab92c879122592251a753dbd3cf48dcee2eaaf20ecc07449edeeb969
MD5 27344d0481d0e0186a59d81cce654311
BLAKE2b-256 de2caf41568ed3fe4dd297b901b74eb55f2259f9316f0ccb15e6372514e9521b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page