mlpack  2.0.1
mean_split.hpp
Go to the documentation of this file.
1 
16 #ifndef __MLPACK_CORE_TREE_BINARY_SPACE_TREE_MEAN_SPLIT_HPP
17 #define __MLPACK_CORE_TREE_BINARY_SPACE_TREE_MEAN_SPLIT_HPP
18 
19 #include <mlpack/core.hpp>
20 
21 namespace mlpack {
22 namespace tree {
23 
29 template<typename BoundType, typename MatType = arma::mat>
30 class MeanSplit
31 {
32  public:
47  static bool SplitNode(const BoundType& bound,
48  MatType& data,
49  const size_t begin,
50  const size_t count,
51  size_t& splitCol);
52 
69  static bool SplitNode(const BoundType& bound,
70  MatType& data,
71  const size_t begin,
72  const size_t count,
73  size_t& splitCol,
74  std::vector<size_t>& oldFromNew);
75 
76  private:
89  static size_t PerformSplit(MatType& data,
90  const size_t begin,
91  const size_t count,
92  const size_t splitDimension,
93  const double splitVal);
94 
109  static size_t PerformSplit(MatType& data,
110  const size_t begin,
111  const size_t count,
112  const size_t splitDimension,
113  const double splitVal,
114  std::vector<size_t>& oldFromNew);
115 };
116 
117 } // namespace tree
118 } // namespace mlpack
119 
120 // Include implementation.
121 #include "mean_split_impl.hpp"
122 
123 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
static size_t PerformSplit(MatType &data, const size_t begin, const size_t count, const size_t splitDimension, const double splitVal)
Reorder the dataset into two parts such that they lie on either side of splitCol. ...
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
A binary space partitioning tree node is split into its left and right child.
Definition: mean_split.hpp:30
static bool SplitNode(const BoundType &bound, MatType &data, const size_t begin, const size_t count, size_t &splitCol)
Split the node according to the mean value in the dimension with maximum width.