Exhaustive nearest neighbors searcher

`ExhustiveSearcher`

model objects store
statistics and options for an exhaustive, nearest neighbors search.
Statistics and options that you can store include the training data,
the distance metric, and the parameter values of the distance metric.
The exhaustive search algorithm finds the distance from each query
observation to all *n* observations in the training
data, which is an *n*-by-*K* numeric
matrix.

Once you create an `ExhaustiveSearcher`

model
object, find neighboring points in the training data to the query
data by performing a nearest neighbors search using `knnsearch`

or
a radius search using `rangesearch`

. The exhaustive search algorithm
is more efficient than the *K*d-tree algorithm when *K* is
large (i.e., *K* ≥ 10), and it is more flexible
than the *K*d-tree algorithm with respect to distance
metric choices. The algorithm also supports sparse data.

Create an `ExhaustiveSearcher`

model object
using `ExhaustiveSearcher`

or `createns`

.

`knnsearch` |
k-nearest neighbors search using Kd-tree or exhaustive search |

`rangesearch` |
Find all neighbors within specified distance using exhaustive search or Kd-tree |

Was this topic helpful?