Giter Club home page Giter Club logo

numba-neighbors's Introduction

Numba Neighbors

Approximate port of scikit-learn neighbors using Numba.

Installation

If you want to install/modify (recommented at this point):

git clone https://github.com/jackd/numba-neighbors.git
pip install -e numba-neighbors

Quick-start:

pip install git+git://github.com/jackd/ifp-sample.git

You may see performance benefits from fastmath by installing Intel's short vector math library (SVML).

conda install -c numba icc_rt

Debugging

Debugging is often simpler without jitting. To disable numba,

export NUMBA_DISABLE_JIT=1

and re-enable with

export NUMBA_DISABLE_JIT=0

Be wary of using os.environ["NUMBA_DISABLE_JIT"] = "1" from python code - this must be set above imports.

Differences compared to Scikit-learn

  1. All operations are done using reduced distances. E.g. provided KDTree implementations use squared distances rather than actual distances both for inputs and outputs.
  2. query_radius-like functions must specify a maximum number of neighbors. Over-estimating this is fairly cheap - it just means we allocate more data than necessary - but if the limit is reached the first max_count neighbors that are found are returned. These aren't necessarily the closest max_count neighbors.
  3. Query outputs aren't sorted, though can be using binary_tree.simultaneous_sort_partial.
  4. Use of Interl's short vector math library (SVML) if instaled. This makes computation faster, but may result in very small errors.

TODO

  • n_nodes is inconsistent with scikit-learn implementation... - scikit bug?
  • Port NeighborsHeap from scikit learn.
  • query implementations.

numba-neighbors's People

Contributors

huite avatar jackd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.