The RAModel class provides an abstraction for the RASearch class, abstracting away the TreeType parameter and allowing it to be specified at runtime in this class. More...

Public Types

enum  TreeTypes
{
  KD_TREE
,
  COVER_TREE
,
  R_TREE
,
  R_STAR_TREE
,
  X_TREE
,
  HILBERT_R_TREE
,
  R_PLUS_TREE
,
  R_PLUS_PLUS_TREE
,
  UB_TREE
,
  OCTREE

}
 The list of tree types we can use with RASearch. More...

 

Public Member Functions

 RAModel (TreeTypes treeType=TreeTypes::KD_TREE, bool randomBasis=false)
 Initialize the RAModel with the given type and whether or not a random basis should be used. More...

 
 RAModel (const RAModel &other)
 Copy the given RAModel. More...

 
 RAModel (RAModel &&other)
 Take ownership of the given RAModel. More...

 
 ~RAModel ()
 Clean memory, if necessary. More...

 
double Alpha () const
 Get the desired success probability. More...

 
double & Alpha ()
 Modify the desired success probability. More...

 
void BuildModel (util::Timers &timers, arma::mat &&referenceSet, const size_t leafSize, const bool naive, const bool singleMode)
 Build the reference tree. More...

 
const arma::mat & Dataset () const
 Expose the dataset. More...

 
bool FirstLeafExact () const
 Get whether or not we traverse to the first leaf without approximation. More...

 
bool & FirstLeafExact ()
 Modify whether or not we traverse to the first leaf without approximation. More...

 
void InitializeModel (const bool naive, const bool singleMode)
 Initialize the model's memory. More...

 
size_t LeafSize () const
 Get the leaf size (only relevant when the kd-tree is used). More...

 
size_t & LeafSize ()
 Modify the leaf size (only relevant when the kd-tree is used). More...

 
bool Naive () const
 Get whether or not naive search is being used. More...

 
bool & Naive ()
 Modify whether or not naive search is being used. More...

 
RAModeloperator= (const RAModel &other)
 Copy the given RAModel. More...

 
RAModeloperator= (RAModel &&other)
 Take ownership of the given RAModel. More...

 
bool RandomBasis () const
 Get whether or not a random basis is being used. More...

 
bool & RandomBasis ()
 Modify whether or not a random basis is being used. More...

 
bool SampleAtLeaves () const
 Get whether or not sampling is done at the leaves. More...

 
bool & SampleAtLeaves ()
 Modify whether or not sampling is done at the leaves. More...

 
void Search (util::Timers &timers, arma::mat &&querySet, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances)
 Perform rank-approximate neighbor search, taking ownership of the query set. More...

 
void Search (util::Timers &timers, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances)
 Perform rank-approximate neighbor search, using the reference set as the query set. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const uint32_t)
 Serialize the model. More...

 
bool SingleMode () const
 Get whether or not single-tree search is being used. More...

 
bool & SingleMode ()
 Modify whether or not single-tree search is being used. More...

 
size_t SingleSampleLimit () const
 Get the limit on the size of a node that can be approximated. More...

 
size_t & SingleSampleLimit ()
 Modify the limit on the size of a node that can be approximation. More...

 
double Tau () const
 Get the rank-approximation in percentile of the data. More...

 
double & Tau ()
 Modify the rank-approximation in percentile of the data. More...

 
std::string TreeName () const
 Get the name of the tree type. More...

 
TreeTypes TreeType () const
 Get the type of tree being used. More...

 
TreeTypesTreeType ()
 Modify the type of tree being used. More...

 

Detailed Description

The RAModel class provides an abstraction for the RASearch class, abstracting away the TreeType parameter and allowing it to be specified at runtime in this class.

This class is written for the sake of the 'allkrann' program, but is not necessarily restricted to that use.

Definition at line 265 of file ra_model.hpp.

Member Enumeration Documentation

◆ TreeTypes

enum TreeTypes

The list of tree types we can use with RASearch.

Does not include ball trees; see #338.

Enumerator
KD_TREE 
COVER_TREE 
R_TREE 
R_STAR_TREE 
X_TREE 
HILBERT_R_TREE 
R_PLUS_TREE 
R_PLUS_PLUS_TREE 
UB_TREE 
OCTREE 

Definition at line 272 of file ra_model.hpp.

Constructor & Destructor Documentation

◆ RAModel() [1/3]

RAModel ( TreeTypes  treeType = TreeTypes::KD_TREE,
bool  randomBasis = false 
)

Initialize the RAModel with the given type and whether or not a random basis should be used.

◆ RAModel() [2/3]

RAModel ( const RAModel other)

Copy the given RAModel.

Parameters
otherRAModel to copy.

◆ RAModel() [3/3]

RAModel ( RAModel &&  other)

Take ownership of the given RAModel.

Parameters
otherRAModel to take ownership of.

◆ ~RAModel()

~RAModel ( )

Clean memory, if necessary.

Member Function Documentation

◆ Alpha() [1/2]

double Alpha ( ) const
inline

Get the desired success probability.

Definition at line 361 of file ra_model.hpp.

References RAWrapperBase::Alpha().

◆ Alpha() [2/2]

double& Alpha ( )
inline

Modify the desired success probability.

Definition at line 363 of file ra_model.hpp.

References RAWrapperBase::Alpha().

◆ BuildModel()

void BuildModel ( util::Timers timers,
arma::mat &&  referenceSet,
const size_t  leafSize,
const bool  naive,
const bool  singleMode 
)

Build the reference tree.

◆ Dataset()

const arma::mat& Dataset ( ) const
inline

Expose the dataset.

Definition at line 343 of file ra_model.hpp.

References RAWrapperBase::Dataset().

◆ FirstLeafExact() [1/2]

bool FirstLeafExact ( ) const
inline

Get whether or not we traverse to the first leaf without approximation.

Definition at line 371 of file ra_model.hpp.

References RAWrapperBase::FirstLeafExact().

◆ FirstLeafExact() [2/2]

bool& FirstLeafExact ( )
inline

Modify whether or not we traverse to the first leaf without approximation.

Definition at line 373 of file ra_model.hpp.

References RAWrapperBase::FirstLeafExact().

◆ InitializeModel()

void InitializeModel ( const bool  naive,
const bool  singleMode 
)

Initialize the model's memory.

◆ LeafSize() [1/2]

size_t LeafSize ( ) const
inline

Get the leaf size (only relevant when the kd-tree is used).

Definition at line 381 of file ra_model.hpp.

◆ LeafSize() [2/2]

size_t& LeafSize ( )
inline

Modify the leaf size (only relevant when the kd-tree is used).

Definition at line 383 of file ra_model.hpp.

◆ Naive() [1/2]

bool Naive ( ) const
inline

Get whether or not naive search is being used.

Definition at line 351 of file ra_model.hpp.

References RAWrapperBase::Naive().

◆ Naive() [2/2]

bool& Naive ( )
inline

Modify whether or not naive search is being used.

Definition at line 353 of file ra_model.hpp.

References RAWrapperBase::Naive().

◆ operator=() [1/2]

RAModel& operator= ( const RAModel other)

Copy the given RAModel.

Parameters
otherRAModel to copy.

◆ operator=() [2/2]

RAModel& operator= ( RAModel &&  other)

Take ownership of the given RAModel.

Parameters
otherRAModel to take ownership of.

◆ RandomBasis() [1/2]

bool RandomBasis ( ) const
inline

Get whether or not a random basis is being used.

Definition at line 391 of file ra_model.hpp.

◆ RandomBasis() [2/2]

bool& RandomBasis ( )
inline

Modify whether or not a random basis is being used.

Be sure to rebuild the model using BuildModel().

Definition at line 394 of file ra_model.hpp.

References RAWrapperBase::Search().

◆ SampleAtLeaves() [1/2]

bool SampleAtLeaves ( ) const
inline

Get whether or not sampling is done at the leaves.

Definition at line 366 of file ra_model.hpp.

References RAWrapperBase::SampleAtLeaves().

◆ SampleAtLeaves() [2/2]

bool& SampleAtLeaves ( )
inline

Modify whether or not sampling is done at the leaves.

Definition at line 368 of file ra_model.hpp.

References RAWrapperBase::SampleAtLeaves().

◆ Search() [1/2]

void Search ( util::Timers timers,
arma::mat &&  querySet,
const size_t  k,
arma::Mat< size_t > &  neighbors,
arma::mat &  distances 
)

Perform rank-approximate neighbor search, taking ownership of the query set.

◆ Search() [2/2]

void Search ( util::Timers timers,
const size_t  k,
arma::Mat< size_t > &  neighbors,
arma::mat &  distances 
)

Perform rank-approximate neighbor search, using the reference set as the query set.

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)

Serialize the model.

◆ SingleMode() [1/2]

bool SingleMode ( ) const
inline

Get whether or not single-tree search is being used.

Definition at line 346 of file ra_model.hpp.

References RAWrapperBase::SingleMode().

◆ SingleMode() [2/2]

bool& SingleMode ( )
inline

Modify whether or not single-tree search is being used.

Definition at line 348 of file ra_model.hpp.

References RAWrapperBase::SingleMode().

◆ SingleSampleLimit() [1/2]

size_t SingleSampleLimit ( ) const
inline

Get the limit on the size of a node that can be approximated.

Definition at line 376 of file ra_model.hpp.

References RAWrapperBase::SingleSampleLimit().

◆ SingleSampleLimit() [2/2]

size_t& SingleSampleLimit ( )
inline

Modify the limit on the size of a node that can be approximation.

Definition at line 378 of file ra_model.hpp.

References RAWrapperBase::SingleSampleLimit().

◆ Tau() [1/2]

double Tau ( ) const
inline

Get the rank-approximation in percentile of the data.

Definition at line 356 of file ra_model.hpp.

References RAWrapperBase::Tau().

◆ Tau() [2/2]

double& Tau ( )
inline

Modify the rank-approximation in percentile of the data.

Definition at line 358 of file ra_model.hpp.

References RAWrapperBase::Tau().

◆ TreeName()

std::string TreeName ( ) const

Get the name of the tree type.

◆ TreeType() [1/2]

TreeTypes TreeType ( ) const
inline

Get the type of tree being used.

Definition at line 386 of file ra_model.hpp.

◆ TreeType() [2/2]

TreeTypes& TreeType ( )
inline

Modify the type of tree being used.

Definition at line 388 of file ra_model.hpp.


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/methods/rann/ra_model.hpp