cosine_tree_builder.hpp

Go to the documentation of this file.
00001 
00022 #ifndef __MLPACK_CORE_TREE_COSINE_TREE_COSINE_TREE_BUILDER_HPP
00023 #define __MLPACK_CORE_TREE_COSINE_TREE_COSINE_TREE_BUILDER_HPP
00024 
00025 #include <mlpack/core.hpp>
00026 #include "cosine_tree.hpp"
00027 
00028 using namespace mlpack::tree;
00029 
00030 namespace mlpack {
00031 namespace tree  {
00032 
00033 class CosineTreeBuilder
00034 {
00035  private:
00043   void LSSampling(arma::mat A, arma::vec& prob);
00044 
00050   arma::rowvec CalculateCentroid(arma::mat A) const;
00051 
00057   size_t GetPivot(arma::vec prob);
00058 
00067   void SplitData(std::vector<double> c, arma::mat& ALeft,
00068                  arma::mat& Aright, arma::mat A);
00069 
00077   void CreateCosineSimilarityArray(std::vector<double>& c,
00078                                    arma::mat A, size_t pivot);
00079 
00085   double GetMaxSimilarity(std::vector<double> c);
00086 
00092   double GetMinSimilarity(std::vector<double> c);
00093 
00094  public:
00096   CosineTreeBuilder();
00098   ~CosineTreeBuilder();
00099 
00106   void CTNode(arma::mat A, CosineTree& root);
00107 
00115   void CTNodeSplit(CosineTree& root, CosineTree& left, CosineTree& right);
00116 };
00117 }; // namespace tree
00118 }; // namespace mlpack
00119 
00120 // Include implementation.
00121 #include "cosine_tree_builder_impl.hpp"
00122 
00123 #endif

Generated on 13 Aug 2014 for MLPACK by  doxygen 1.6.1