mlpack
Public Member Functions | List of all members
mlpack::neighbor::DrusillaSelect< MatType > Class Template Reference

Public Member Functions

 DrusillaSelect (const MatType &referenceSet, const size_t l, const size_t m)
 Construct the DrusillaSelect object with the given reference set (this is the set that will be searched). More...
 
 DrusillaSelect (const size_t l, const size_t m)
 Construct the DrusillaSelect object with no given reference set. More...
 
void Train (const MatType &referenceSet, const size_t l=0, const size_t m=0)
 Build the set of candidate points on the given reference set. More...
 
void Search (const MatType &querySet, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances)
 Search for the k furthest neighbors of the given query set. More...
 
template<typename Archive >
void serialize (Archive &ar, const uint32_t)
 Serialize the model.
 
const MatType & CandidateSet () const
 Access the candidate set.
 
MatType & CandidateSet ()
 Modify the candidate set. Be careful!
 
const arma::Col< size_t > & CandidateIndices () const
 Access the indices of points in the candidate set.
 
arma::Col< size_t > & CandidateIndices ()
 Modify the indices of points in the candidate set. Be careful!
 

Constructor & Destructor Documentation

◆ DrusillaSelect() [1/2]

template<typename MatType >
mlpack::neighbor::DrusillaSelect< MatType >::DrusillaSelect ( const MatType &  referenceSet,
const size_t  l,
const size_t  m 
)

Construct the DrusillaSelect object with the given reference set (this is the set that will be searched).

The resulting set of candidate points that will be searched at query time will have size l*m.

Parameters
referenceSetSet of reference data.
lNumber of projections.
mNumber of elements to store for each projection.

◆ DrusillaSelect() [2/2]

template<typename MatType >
mlpack::neighbor::DrusillaSelect< MatType >::DrusillaSelect ( const size_t  l,
const size_t  m 
)

Construct the DrusillaSelect object with no given reference set.

Be sure to call Train() before calling Search()!

Parameters
lNumber of projections.
mNumber of elements to store for each projection.

Member Function Documentation

◆ Search()

template<typename MatType >
void mlpack::neighbor::DrusillaSelect< MatType >::Search ( const MatType &  querySet,
const size_t  k,
arma::Mat< size_t > &  neighbors,
arma::mat &  distances 
)

Search for the k furthest neighbors of the given query set.

(The query set can contain just one point: that is okay.) The results will be stored in the given neighbors and distances matrices, in the same format as the NeighborSearch and LSHSearch classes. That is, each column in the neighbors and distances matrices will refer to a single query point, and the k'th row in that column will refer to the k'th candidate neighbor or distance for that query point.

Parameters
querySetSet of query points to search.
kNumber of furthest neighbors to search for.
neighborsMatrix to store resulting neighbors in.
distancesMatrix to store resulting distances in.

◆ Train()

template<typename MatType >
void mlpack::neighbor::DrusillaSelect< MatType >::Train ( const MatType &  referenceSet,
const size_t  l = 0,
const size_t  m = 0 
)

Build the set of candidate points on the given reference set.

If l and m are left unspecified, then the values set in the constructor will be used instead.

Parameters
referenceSetSet to extract candidate points from.
lNumber of projections.
mNumber of elements to store for each projection.

The documentation for this class was generated from the following files: