MLPACK  1.0.8
cosine_tree_builder.hpp
Go to the documentation of this file.
1 
22 #ifndef __MLPACK_CORE_TREE_COSINE_TREE_COSINE_TREE_BUILDER_HPP
23 #define __MLPACK_CORE_TREE_COSINE_TREE_COSINE_TREE_BUILDER_HPP
24 
25 #include <mlpack/core.hpp>
26 #include "cosine_tree.hpp"
27 
28 using namespace mlpack::tree;
29 
30 namespace mlpack {
31 namespace tree {
32 
34 {
35  private:
43  void LSSampling(arma::mat A, arma::vec& prob);
44 
50  arma::rowvec CalculateCentroid(arma::mat A) const;
51 
57  size_t GetPivot(arma::vec prob);
58 
67  void SplitData(std::vector<double> c, arma::mat& ALeft,
68  arma::mat& Aright, arma::mat A);
69 
77  void CreateCosineSimilarityArray(std::vector<double>& c,
78  arma::mat A, size_t pivot);
79 
85  double GetMaxSimilarity(std::vector<double> c);
86 
92  double GetMinSimilarity(std::vector<double> c);
93 
94  public:
99 
106  void CTNode(arma::mat A, CosineTree& root);
107 
115  void CTNodeSplit(CosineTree& root, CosineTree& left, CosineTree& right);
116 };
117 }; // namespace tree
118 }; // namespace mlpack
119 
120 // Include implementation.
121 #include "cosine_tree_builder_impl.hpp"
122 
123 #endif