MLPACK
1.0.11
|
Neighbor-search routines. More...
Classes | |
class | FurthestNeighborSort |
This class implements the necessary methods for the SortPolicy template parameter of the NeighborSearch class. More... | |
class | LSHSearch |
The LSHSearch class – This class builds a hash on the reference set and uses this hash to compute the distance-approximate nearest-neighbors of the given queries. More... | |
class | NearestNeighborSort |
This class implements the necessary methods for the SortPolicy template parameter of the NeighborSearch class. More... | |
class | NeighborSearch |
The NeighborSearch class is a template class for performing distance-based neighbor searches. More... | |
class | NeighborSearchRules |
class | NeighborSearchStat |
Extra data for each node in the tree. More... | |
class | NeighborSearchTraversalInfo |
Traversal information for NeighborSearch. More... | |
class | RASearchRules |
Typedefs | |
typedef NeighborSearch< FurthestNeighborSort, metric::EuclideanDistance > | AllkFN |
The AllkFN class is the all-k-furthest-neighbors method. More... | |
typedef NeighborSearch< NearestNeighborSort, metric::EuclideanDistance > | AllkNN |
The AllkNN class is the all-k-nearest-neighbors method. More... | |
typedef RASearch< FurthestNeighborSort > | AllkRAFN |
The AllkRAFN class is the all-k-rank-approximate-farthest-neighbors method. More... | |
typedef RASearch | AllkRANN |
The AllkRANN class is the all-k-rank-approximate-nearest-neighbors method. More... | |
Functions | |
void | Unmap (const arma::Mat< size_t > &neighbors, const arma::mat &distances, const std::vector< size_t > &referenceMap, const std::vector< size_t > &queryMap, arma::Mat< size_t > &neighborsOut, arma::mat &distancesOut, const bool squareRoot=false) |
Assuming that the datasets have been mapped using the referenceMap and the queryMap (such as during kd-tree construction), unmap the columns of the distances and neighbors matrices into neighborsOut and distancesOut, and also unmap the entries in each row of neighbors. More... | |
void | Unmap (const arma::Mat< size_t > &neighbors, const arma::mat &distances, const std::vector< size_t > &referenceMap, arma::Mat< size_t > &neighborsOut, arma::mat &distancesOut, const bool squareRoot=false) |
Assuming that the datasets have been mapped using referenceMap (such as during kd-tree construction), unmap the columns of the distances and neighbors matrices into neighborsOut and distancesOut, and also unmap the entries in each row of neighbors. More... | |
Neighbor-search routines.
These include all-nearest-neighbors and all-furthest-neighbors searches.
The AllkFN class is the all-k-furthest-neighbors method.
It returns L2 distances (Euclidean distances) for each of the k furthest neighbors.
Definition at line 48 of file typedef.hpp.
The AllkNN class is the all-k-nearest-neighbors method.
It returns L2 distances (Euclidean distances) for each of the k nearest neighbors.
Definition at line 42 of file typedef.hpp.
The AllkRAFN class is the all-k-rank-approximate-farthest-neighbors method.
It returns squared L2 distances (squared Euclidean distances) for each of the k rank-approximate farthest-neighbors. Squared distances are used because they are slightly faster than non-squared distances (they have one fewer call to sqrt()).
The approximation is controlled with two parameters (see allkrann_main.cpp) which can be specified at search time. So the tree building is done only once while the search can be performed multiple times with different approximation levels.
Definition at line 63 of file ra_typedef.hpp.
typedef RASearch mlpack::neighbor::AllkRANN |
The AllkRANN class is the all-k-rank-approximate-nearest-neighbors method.
It returns squared L2 distances (squared Euclidean distances) for each of the k rank-approximate nearest-neighbors. Squared distances are used because they are slightly faster than non-squared distances (they have one fewer call to sqrt()).
The approximation is controlled with two parameters (see allkrann_main.cpp) which can be specified at search time. So the tree building is done only once while the search can be performed multiple times with different approximation levels.
Definition at line 49 of file ra_typedef.hpp.
void mlpack::neighbor::Unmap | ( | const arma::Mat< size_t > & | neighbors, |
const arma::mat & | distances, | ||
const std::vector< size_t > & | referenceMap, | ||
const std::vector< size_t > & | queryMap, | ||
arma::Mat< size_t > & | neighborsOut, | ||
arma::mat & | distancesOut, | ||
const bool | squareRoot = false |
||
) |
Assuming that the datasets have been mapped using the referenceMap and the queryMap (such as during kd-tree construction), unmap the columns of the distances and neighbors matrices into neighborsOut and distancesOut, and also unmap the entries in each row of neighbors.
This is useful for the dual-tree case.
neighbors | Matrix of neighbors resulting from neighbor search. |
distances | Matrix of distances resulting from neighbor search. |
referenceMap | Mapping of reference set to old points. |
queryMap | Mapping of query set to old points. |
neighborsOut | Matrix to store unmapped neighbors into. |
distancesOut | Matrix to store unmapped distances into. |
squareRoot | If true, take the square root of the distances. |
void mlpack::neighbor::Unmap | ( | const arma::Mat< size_t > & | neighbors, |
const arma::mat & | distances, | ||
const std::vector< size_t > & | referenceMap, | ||
arma::Mat< size_t > & | neighborsOut, | ||
arma::mat & | distancesOut, | ||
const bool | squareRoot = false |
||
) |
Assuming that the datasets have been mapped using referenceMap (such as during kd-tree construction), unmap the columns of the distances and neighbors matrices into neighborsOut and distancesOut, and also unmap the entries in each row of neighbors.
This is useful for the single-tree case.
neighbors | Matrix of neighbors resulting from neighbor search. |
distances | Matrix of distances resulting from neighbor search. |
referenceMap | Mapping of reference set to old points. |
neighborsOut | Matrix to store unmapped neighbors into. |
distancesOut | Matrix to store unmapped distances into. |
squareRoot | If true, take the square root of the distances. |