vptree


Namevptree JSON
Version 1.3 PyPI version JSON
download
home_pagehttps://github.com/RickardSjogren/vptree
SummaryA package implementing a vantage-point data structure, for efficient nearest neighbor searching.
upload_time2022-05-18 19:21:48
maintainer
docs_urlNone
authorRickard Sjögren
requires_python
licenseMIT
keywords python machine learning search
VCS
bugtrack_url
requirements numpy pytest
Travis-CI No Travis.
coveralls test coverage No coveralls.
            VP-Tree
=======

.. image:: https://badge.fury.io/py/vptree.svg
    :target: https://badge.fury.io/py/vptree

.. image:: https://app.travis-ci.com/RickardSjogren/vptree.svg?branch=master
    :target: https://app.travis-ci.com/RickardSjogren/vptree

This package contains an implementation of a `vantage-point tree <https://en.wikipedia.org/wiki/Vantage-point_tree>`_ data structure.

Installation
------------

Simply install through pip:

.. code-block::

  pip install vptree

Example
-------

Example usage:

.. code-block:: python

  import numpy as np
  import vptree
  
  # Define distance function.
  def euclidean(p1, p2):
    return np.sqrt(np.sum(np.power(p2 - p1, 2)))
  
  # Generate some random points.
  points = np.random.randn(20000, 10)
  query = [.5] * 10
  
  # Build tree in O(n log n) time complexity.
  tree = vptree.VPTree(points, euclidean)   
  
  # Query single point.
  tree.get_nearest_neighbor(query)
  
  # Query n-points.
  tree.get_n_nearest_neighbors(query, 10)
  
  # Get all points within certain distance.
  tree.get_all_in_range(query, 3.14)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/RickardSjogren/vptree",
    "name": "vptree",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python machine learning search",
    "author": "Rickard Sj\u00f6gren",
    "author_email": "r.sjogren89@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/38/f5/535b223cc11368d7b30059a72fc4a23797d509a6d491df6f3f3d99652bea/vptree-1.3.tar.gz",
    "platform": null,
    "description": "VP-Tree\r\n=======\r\n\r\n.. image:: https://badge.fury.io/py/vptree.svg\r\n    :target: https://badge.fury.io/py/vptree\r\n\r\n.. image:: https://app.travis-ci.com/RickardSjogren/vptree.svg?branch=master\r\n    :target: https://app.travis-ci.com/RickardSjogren/vptree\r\n\r\nThis package contains an implementation of a `vantage-point tree <https://en.wikipedia.org/wiki/Vantage-point_tree>`_ data structure.\r\n\r\nInstallation\r\n------------\r\n\r\nSimply install through pip:\r\n\r\n.. code-block::\r\n\r\n  pip install vptree\r\n\r\nExample\r\n-------\r\n\r\nExample usage:\r\n\r\n.. code-block:: python\r\n\r\n  import numpy as np\r\n  import vptree\r\n  \r\n  # Define distance function.\r\n  def euclidean(p1, p2):\r\n    return np.sqrt(np.sum(np.power(p2 - p1, 2)))\r\n  \r\n  # Generate some random points.\r\n  points = np.random.randn(20000, 10)\r\n  query = [.5] * 10\r\n  \r\n  # Build tree in O(n log n) time complexity.\r\n  tree = vptree.VPTree(points, euclidean)   \r\n  \r\n  # Query single point.\r\n  tree.get_nearest_neighbor(query)\r\n  \r\n  # Query n-points.\r\n  tree.get_n_nearest_neighbors(query, 10)\r\n  \r\n  # Get all points within certain distance.\r\n  tree.get_all_in_range(query, 3.14)\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A package implementing a vantage-point data structure, for efficient nearest neighbor searching.",
    "version": "1.3",
    "split_keywords": [
        "python",
        "machine",
        "learning",
        "search"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "9684daa84576d299f4301918b871b552",
                "sha256": "a412a833a6ab18936b96c5e21177a462fb438b26d285e258cb836df8fd01a97d"
            },
            "downloads": -1,
            "filename": "vptree-1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "9684daa84576d299f4301918b871b552",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4449,
            "upload_time": "2022-05-18T19:21:48",
            "upload_time_iso_8601": "2022-05-18T19:21:48.238086Z",
            "url": "https://files.pythonhosted.org/packages/38/f5/535b223cc11368d7b30059a72fc4a23797d509a6d491df6f3f3d99652bea/vptree-1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-05-18 19:21:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "RickardSjogren",
    "github_project": "vptree",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "pytest",
            "specs": []
        }
    ],
    "lcname": "vptree"
}
        
Elapsed time: 0.01703s