random_dimension_select.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_DECISION_TREE_RANDOM_DIMENSION_SELECT_HPP
13 #define MLPACK_METHODS_DECISION_TREE_RANDOM_DIMENSION_SELECT_HPP
14 
15 namespace mlpack {
16 namespace tree {
17 
22 {
23  public:
28  RandomDimensionSelect(const size_t dimensions) : dimensions(dimensions) { }
29 
33  size_t Begin() const { return math::RandInt(dimensions); }
34 
38  size_t End() const { return dimensions; }
39 
44  size_t Next() const { return dimensions; }
45 
46  private:
48  const size_t dimensions;
49 };
50 
51 } // namespace tree
52 } // namespace mlpack
53 
54 #endif
size_t Begin() const
Get the first dimension to select from.
size_t End() const
Get the last dimension to select from.
.hpp
Definition: add_to_po.hpp:21
This dimension selection policy only selects one single random dimension.
size_t Next() const
Get the next (last) dimensions.
int RandInt(const int hiExclusive)
Generates a uniform random integer.
Definition: random.hpp:87
RandomDimensionSelect(const size_t dimensions)
Construct the RandomDimensionSelect object with the given number of dimensions.