ensmallen
mlpack
fast, flexible C++ machine learning library
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...

 

Detailed Description


template
<
typename
MatType
=
arma::mat
>

class mlpack::neighbor::DrusillaSelect< MatType >

Definition at line 39 of file drusilla_select.hpp.

Constructor & Destructor Documentation

◆ DrusillaSelect() [1/2]

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]

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

◆ CandidateIndices() [1/2]

const arma::Col<size_t>& CandidateIndices ( ) const
inline

Access the indices of points in the candidate set.

Definition at line 108 of file drusilla_select.hpp.

◆ CandidateIndices() [2/2]

arma::Col<size_t>& CandidateIndices ( )
inline

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

Definition at line 110 of file drusilla_select.hpp.

◆ CandidateSet() [1/2]

const MatType& CandidateSet ( ) const
inline

Access the candidate set.

Definition at line 103 of file drusilla_select.hpp.

◆ CandidateSet() [2/2]

MatType& CandidateSet ( )
inline

Modify the candidate set. Be careful!

Definition at line 105 of file drusilla_select.hpp.

◆ Search()

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.

(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.

◆ serialize()

void serialize ( Archive &  ar,
const unsigned  int 
)

Serialize the model.

◆ Train()

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.

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 file: