Nearest neighbor search with L_p distance. More...
Public Types | |
using | NeighborSearchType = neighbor::NeighborSearch< neighbor::NearestNeighborSort, metric::LMetric< TPower, true > > |
Public Member Functions | |
LMetricSearch (const arma::mat &referenceSet) | |
void | Search (const arma::mat &query, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &similarities) |
Given a set of query points, find the nearest k neighbors, and return similarites. More... | |
Nearest neighbor search with L_p distance.
An example of how to use LMetricSearch in CF is shown below:
TPower | Power of metric. |
Definition at line 42 of file lmetric_search.hpp.
using NeighborSearchType = neighbor::NeighborSearch< neighbor::NearestNeighborSort, metric::LMetric<TPower, true> > |
Definition at line 47 of file lmetric_search.hpp.
|
inline |
referenceSet | Set of reference points. |
Definition at line 52 of file lmetric_search.hpp.
|
inline |
Given a set of query points, find the nearest k neighbors, and return similarites.
Similarities are non-negative and no larger thant one.
query | A set of query points. |
k | Number of neighbors to search. |
neighbors | Nearest neighbors. |
similarities | Similarities between query point and its neighbors. |
Definition at line 64 of file lmetric_search.hpp.