Nearest Neighbors implementation using binary trees. More...
#include <shark/Algorithms/NearestNeighbors/TreeNearestNeighbors.h>
Public Types | |
typedef LabeledData< InputType, LabelType > | Dataset |
typedef BinaryTree< InputType > | Tree |
typedef base_type::DistancePair | DistancePair |
typedef Batch< InputType >::type | BatchInputType |
Public Types inherited from shark::AbstractNearestNeighbors< InputType, LabelType > | |
typedef KeyValuePair< double, LabelType > | DistancePair |
typedef Batch< InputType >::type | BatchInputType |
Public Member Functions | |
TreeNearestNeighbors (Dataset const &dataset, Tree const *tree) | |
std::vector< DistancePair > | getNeighbors (BatchInputType const &patterns, std::size_t k) const |
returns the k nearest neighbors of the point More... | |
LabeledData< InputType, LabelType > const & | dataset () const |
returns a const reference to the dataset used by the algorithm More... | |
Public Member Functions inherited from shark::AbstractNearestNeighbors< InputType, LabelType > | |
Shape const & | inputShape () const |
Returns the expected shape of the inputs. More... | |
virtual | ~AbstractNearestNeighbors () |
Additional Inherited Members | |
Protected Attributes inherited from shark::AbstractNearestNeighbors< InputType, LabelType > | |
Shape | m_inputShape |
Nearest Neighbors implementation using binary trees.
Returns the labels and distances of the k nearest neighbors of a point.
Definition at line 408 of file TreeNearestNeighbors.h.
typedef Batch<InputType>::type shark::TreeNearestNeighbors< InputType, LabelType >::BatchInputType |
Definition at line 417 of file TreeNearestNeighbors.h.
typedef LabeledData<InputType, LabelType> shark::TreeNearestNeighbors< InputType, LabelType >::Dataset |
Definition at line 414 of file TreeNearestNeighbors.h.
typedef base_type::DistancePair shark::TreeNearestNeighbors< InputType, LabelType >::DistancePair |
Definition at line 416 of file TreeNearestNeighbors.h.
typedef BinaryTree<InputType> shark::TreeNearestNeighbors< InputType, LabelType >::Tree |
Definition at line 415 of file TreeNearestNeighbors.h.
|
inline |
Definition at line 419 of file TreeNearestNeighbors.h.
References shark::LabeledData< InputT, LabelT >::inputShape().
|
inlinevirtual |
returns a const reference to the dataset used by the algorithm
Implements shark::AbstractNearestNeighbors< InputType, LabelType >.
Definition at line 444 of file TreeNearestNeighbors.h.
|
inlinevirtual |
returns the k nearest neighbors of the point
Implements shark::AbstractNearestNeighbors< InputType, LabelType >.
Definition at line 429 of file TreeNearestNeighbors.h.
References shark::batchSize().