MLPACK  1.0.8
Public Member Functions | Private Member Functions | List of all members
mlpack::tree::CosineTreeBuilder Class Reference

Public Member Functions

 CosineTreeBuilder ()
 Empty Constructor. More...
 
 ~CosineTreeBuilder ()
 Destructor. More...
 
void CTNode (arma::mat A, CosineTree &root)
 Creates a new cosine tree node. More...
 
void CTNodeSplit (CosineTree &root, CosineTree &left, CosineTree &right)
 Splits a cosine tree node. More...
 

Private Member Functions

arma::rowvec CalculateCentroid (arma::mat A) const
 Calculates the centroid of the matrix. More...
 
void CreateCosineSimilarityArray (std::vector< double > &c, arma::mat A, size_t pivot)
 Creates Cosine Similarity Array. More...
 
double GetMaxSimilarity (std::vector< double > c)
 Calculates Maximum Cosine Similarity. More...
 
double GetMinSimilarity (std::vector< double > c)
 Calculates Maximum Cosine Similarity. More...
 
size_t GetPivot (arma::vec prob)
 Calculates the Pivot for splitting. More...
 
void LSSampling (arma::mat A, arma::vec &prob)
 Length Square Sampling method for sampling rows of the matrix. More...
 
void SplitData (std::vector< double > c, arma::mat &ALeft, arma::mat &Aright, arma::mat A)
 Splits the points into the root node into children nodes. More...
 

Detailed Description

Definition at line 33 of file cosine_tree_builder.hpp.

Constructor & Destructor Documentation

mlpack::tree::CosineTreeBuilder::CosineTreeBuilder ( )

Empty Constructor.

mlpack::tree::CosineTreeBuilder::~CosineTreeBuilder ( )

Destructor.

Member Function Documentation

arma::rowvec mlpack::tree::CosineTreeBuilder::CalculateCentroid ( arma::mat  A) const
private

Calculates the centroid of the matrix.

Parameters
AMatrix for which the centroid has to be calculated
void mlpack::tree::CosineTreeBuilder::CreateCosineSimilarityArray ( std::vector< double > &  c,
arma::mat  A,
size_t  pivot 
)
private

Creates Cosine Similarity Array.

Parameters
cArray of Cosine Similarity
AAll points
pivotpivot point
void mlpack::tree::CosineTreeBuilder::CTNode ( arma::mat  A,
CosineTree root 
)

Creates a new cosine tree node.

Parameters
AData for constructing the node
rootReference to the constructed node
void mlpack::tree::CosineTreeBuilder::CTNodeSplit ( CosineTree root,
CosineTree left,
CosineTree right 
)

Splits a cosine tree node.

Parameters
rootNode to be split
rightreference to the right child
leftreference to the left child
double mlpack::tree::CosineTreeBuilder::GetMaxSimilarity ( std::vector< double >  c)
private

Calculates Maximum Cosine Similarity.

Parameters
cArray of Cosine Similarities
double mlpack::tree::CosineTreeBuilder::GetMinSimilarity ( std::vector< double >  c)
private

Calculates Maximum Cosine Similarity.

Parameters
cArray of Cosine Similarities
size_t mlpack::tree::CosineTreeBuilder::GetPivot ( arma::vec  prob)
private

Calculates the Pivot for splitting.

Parameters
probProbability for a point to act as the pivot
void mlpack::tree::CosineTreeBuilder::LSSampling ( arma::mat  A,
arma::vec &  prob 
)
private

Length Square Sampling method for sampling rows of the matrix.

Parameters
AMatrix for which probabilities are calculated
probReference to the probability vector
void mlpack::tree::CosineTreeBuilder::SplitData ( std::vector< double >  c,
arma::mat &  ALeft,
arma::mat &  Aright,
arma::mat  A 
)
private

Splits the points into the root node into children nodes.

Parameters
cArray of Cosin Similarities
ALeftMatrix for storing the points in Left Node
ARightMatrix for storing the points in Right Node
AAll points

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