ngeiswei / cover-tree Goto Github PK
View Code? Open in Web Editor NEWThis project forked from dncrane/cover-tree
C++ implementation of the cover tree datastructure for quick k-nearest-neighbor search.
This project forked from dncrane/cover-tree
C++ implementation of the cover tree datastructure for quick k-nearest-neighbor search.
This is a C++ implementation of the cover tree datastructure. Implements the cover tree algorithms for insert, removal, and k-nearest-neighbor search. Relevant links: https://secure.wikimedia.org/wikipedia/en/wiki/Cover_tree - Wikipedia's page on cover trees. http://hunch.net/~jl/projects/cover_tree/cover_tree.html - John Langford's (one of the inventors of cover trees) page on cover trees with links to papers. To use the Cover Tree, you must implement your own Point class. CoverTreePoint is provided for testing and as an example. Your Point class must implement the following functions: double YourPoint::distance(const YourPoint& p); bool YourPoint::operator==(const YourPoint& p); and optionally (for debugging/printing only): void YourPoint::print(); The distance function must be a Metric, meaning (from Wikipedia): 1: d(x, y) = 0 if and only if x = y 2: d(x, y) = d(y, x) (symmetry) 3: d(x, z) =< d(x, y) + d(y, z) (subadditivity / triangle inequality). See https://secure.wikimedia.org/wikipedia/en/wiki/Metric_%28mathematics%29 for details. Actually, 1 does not exactly need to hold for this implementation; you can provide, for example, names for your points which are unrelated to distance but important for equality. You can insert multiple points with distance 0 to each other and the tree will keep track of them, but you cannot insert multiple points that are equal to each other; attempting to insert a point that already exists in the tree will not alter the tree at all. If you do not want to allow multiple nodes with distance 0, then just make your equality operator always return true when distance is 0. If you want to allow multiple points of distance 0 but do not want to add a name or other identifier to them, you can have your equality operator always return false. TODO: -The papers describe batch insert and batch-nearest-neighbors algorithms which may be worth implementing. -Try using a third "upper bound" argument for distance functions, beyond which the distance does not need to be calculated, to improve efficiency in practice.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.