K nearest neighbour in python

sramij picture sramij · Apr 6, 2011 · Viewed 32.7k times · Source

I would like to calculate K-nearest neighbour in python. what library should i use?

Answer

Sandro Munda picture Sandro Munda · Apr 6, 2011

I think that you should use scikit ann.

There is a good tutorial about the nearest neightbour here.

According to the documentation :

ann is a SWIG-generated python wrapper for the Approximate Nearest Neighbor (ANN) Library (http://www.cs.umd.edu/~mount/ANN/), developed by David M. Mount and Sunil Arya. ann provides an immutable kdtree implementation (via ANN) which can perform k-nearest neighbor and approximate k