# Crate space[−][src]

## Expand description

See the Crates.io page for the README.

## Structs

Performs a linear knn search by iterating over everything in the space and performing a binary search on running set of neighbors.

For k-NN algorithms to return neighbors.

## Traits

Implement this trait on data structures (or wrappers) which perform KNN searches. The data structure should maintain a key-value mapping between neighbour points and data values.

Create a data structure from a batch of data points, such as a vector. For many algorithms, using batch initialization yields better results than inserting the points one at a time.

Create a data structure from a metric and a batch of data points, such as a vector. For many algorithms, using batch initialization yields better results than inserting the points one at a time.

Implement this trait on KNN search data structures that map keys to values and which you can insert new (key, value) pairs.

This trait is implemented for metrics that form a metric space.
It is primarily used for keys in nearest neighbor searches.
When implementing this trait, it is recommended to choose the smallest unsigned integer that
represents your metric space, but you may also use a float so long as you wrap it in
a newtype that enforces the `Ord + Zero + Copy`

trait bounds.
It is recommended to use
`NoisyFloat`

for this purpose, as it implements the trait bound.

Implement this trait on data structures (or wrappers) which perform range queries. The data structure should maintain a key-value mapping between neighbour points and data values.