mlpack  2.0.1
midpoint_split.hpp
Go to the documentation of this file.
1 
17 #ifndef __MLPACK_CORE_TREE_BINARY_SPACE_TREE_MIDPOINT_SPLIT_HPP
18 #define __MLPACK_CORE_TREE_BINARY_SPACE_TREE_MIDPOINT_SPLIT_HPP
19 
20 #include <mlpack/core.hpp>
21 
22 namespace mlpack {
23 namespace tree {
24 
30 template<typename BoundType, typename MatType = arma::mat>
32 {
33  public:
48  static bool SplitNode(const BoundType& bound,
49  MatType& data,
50  const size_t begin,
51  const size_t count,
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& splitCol,
75  std::vector<size_t>& oldFromNew);
76 
77  private:
90  static size_t PerformSplit(MatType& data,
91  const size_t begin,
92  const size_t count,
93  const size_t splitDimension,
94  const double splitVal);
95 
110  static size_t PerformSplit(MatType& data,
111  const size_t begin,
112  const size_t count,
113  const size_t splitDimension,
114  const double splitVal,
115  std::vector<size_t>& oldFromNew);
116 };
117 
118 } // namespace tree
119 } // namespace mlpack
120 
121 // Include implementation.
122 #include "midpoint_split_impl.hpp"
123 
124 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
A binary space partitioning tree node is split into its left and right child.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
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.
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. ...