mlpack  1.0.12
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& splitDimension,
52  size_t& splitCol);
53 
70  static bool SplitNode(const BoundType& bound,
71  MatType& data,
72  const size_t begin,
73  const size_t count,
74  size_t& splitDimension,
75  size_t& splitCol,
76  std::vector<size_t>& oldFromNew);
77 
78  private:
91  static size_t PerformSplit(MatType& data,
92  const size_t begin,
93  const size_t count,
94  const size_t splitDimension,
95  const double splitVal);
96 
111  static size_t PerformSplit(MatType& data,
112  const size_t begin,
113  const size_t count,
114  const size_t splitDimension,
115  const double splitVal,
116  std::vector<size_t>& oldFromNew);
117 };
118 
119 }; // namespace tree
120 }; // namespace mlpack
121 
122 // Include implementation.
123 #include "mean_split_impl.hpp"
124 
125 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:23
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. ...
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 &splitDimension, size_t &splitCol)
Split the node according to the mean value in the dimension with maximum width.