mlpack  master
Public Member Functions | Private Attributes | 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...
 
const arma::Col< size_t > & CandidateIndices () const
 Access the indices of points in the candidate set. More...
 
arma::Col< size_t > & CandidateIndices ()
 Modify the indices of points in the candidate set. Be careful! More...
 
const MatType & CandidateSet () const
 Access the candidate set. More...
 
MatType & CandidateSet ()
 Modify the candidate set. Be careful! 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 unsigned int)
 Serialize the model. 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...
 

Private Attributes

arma::Col< size_t > candidateIndices
 Indices of each point in the reference set. More...
 
MatType candidateSet
 The reference set. More...
 
size_t l
 The number of projections. More...
 
size_t m
 The number of points in each projection. More...
 

Detailed Description

template<typename MatType = arma::mat>
class mlpack::neighbor::DrusillaSelect< MatType >

Definition at line 39 of file drusilla_select.hpp.

Constructor & Destructor Documentation

template<typename MatType = arma::mat>
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.
template<typename MatType = arma::mat>
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

template<typename MatType = arma::mat>
const arma::Col<size_t>& mlpack::neighbor::DrusillaSelect< MatType >::CandidateIndices ( ) const
inline

Access the indices of points in the candidate set.

Definition at line 108 of file drusilla_select.hpp.

References mlpack::neighbor::DrusillaSelect< MatType >::candidateIndices.

template<typename MatType = arma::mat>
arma::Col<size_t>& mlpack::neighbor::DrusillaSelect< MatType >::CandidateIndices ( )
inline

Modify the indices of points in the candidate set. Be careful!

Definition at line 110 of file drusilla_select.hpp.

References mlpack::neighbor::DrusillaSelect< MatType >::candidateIndices.

template<typename MatType = arma::mat>
const MatType& mlpack::neighbor::DrusillaSelect< MatType >::CandidateSet ( ) const
inline

Access the candidate set.

Definition at line 103 of file drusilla_select.hpp.

References mlpack::neighbor::DrusillaSelect< MatType >::candidateSet.

template<typename MatType = arma::mat>
MatType& mlpack::neighbor::DrusillaSelect< MatType >::CandidateSet ( )
inline

Modify the candidate set. Be careful!

Definition at line 105 of file drusilla_select.hpp.

References mlpack::neighbor::DrusillaSelect< MatType >::candidateSet.

template<typename MatType = arma::mat>
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.
template<typename MatType = arma::mat>
template<typename Archive >
void mlpack::neighbor::DrusillaSelect< MatType >::Serialize ( Archive &  ar,
const unsigned  int 
)

Serialize the model.

template<typename MatType = arma::mat>
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.

Member Data Documentation

template<typename MatType = arma::mat>
arma::Col<size_t> mlpack::neighbor::DrusillaSelect< MatType >::candidateIndices
private

Indices of each point in the reference set.

Definition at line 116 of file drusilla_select.hpp.

Referenced by mlpack::neighbor::DrusillaSelect< MatType >::CandidateIndices().

template<typename MatType = arma::mat>
MatType mlpack::neighbor::DrusillaSelect< MatType >::candidateSet
private

The reference set.

Definition at line 114 of file drusilla_select.hpp.

Referenced by mlpack::neighbor::DrusillaSelect< MatType >::CandidateSet().

template<typename MatType = arma::mat>
size_t mlpack::neighbor::DrusillaSelect< MatType >::l
private

The number of projections.

Definition at line 119 of file drusilla_select.hpp.

template<typename MatType = arma::mat>
size_t mlpack::neighbor::DrusillaSelect< MatType >::m
private

The number of points in each projection.

Definition at line 121 of file drusilla_select.hpp.


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