12 #ifndef MLPACK_METHODS_DECISION_TREE_MULTIPLE_RANDOM_DIMENSION_SPLIT_HPP 13 #define MLPACK_METHODS_DECISION_TREE_MULTIPLE_RANDOM_DIMENSION_SPLIT_HPP 32 numDimensions(numDimensions),
43 if (numDimensions == 0 || numDimensions > dimensions)
44 numDimensions = (size_t) std::sqrt(dimensions);
46 values.set_size(numDimensions + 1);
49 for (
size_t i = 0; i < numDimensions; ++i)
60 for (
size_t j = 0; j < i; ++j)
62 if (values[j] == value)
73 values[numDimensions] = std::numeric_limits<size_t>::max();
82 size_t End()
const {
return size_t(-1); }
101 arma::Col<size_t> values;
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
size_t End() const
Get the last random value.
Definition: multiple_random_dimension_select.hpp:82
size_t & Dimensions()
Set the number of dimensions.
Definition: multiple_random_dimension_select.hpp:95
This dimension selection policy allows the selection from a few random dimensions.
Definition: multiple_random_dimension_select.hpp:23
size_t Next()
Get the next index.
Definition: multiple_random_dimension_select.hpp:87
MultipleRandomDimensionSelect(const size_t numDimensions=0)
Instantiate the MultipleRandomDimensionSelect object.
Definition: multiple_random_dimension_select.hpp:31
size_t Begin()
Get the first random value.
Definition: multiple_random_dimension_select.hpp:40
size_t Dimensions() const
Get the number of dimensions.
Definition: multiple_random_dimension_select.hpp:93
int RandInt(const int hiExclusive)
Generates a uniform random integer.
Definition: random.hpp:110