13 #ifndef MLPACK_METHODS_HOEFFDING_TREES_HOEFFDING_CATEGORICAL_SPLIT_HPP 14 #define MLPACK_METHODS_HOEFFDING_TREES_HOEFFDING_CATEGORICAL_SPLIT_HPP 43 template<
typename FitnessFunction>
58 const size_t numClasses = 0);
67 const size_t numClasses,
77 void Train(eT value,
const size_t label);
93 size_t NumChildren()
const {
return sufficientStatistics.n_cols; }
102 void Split(arma::Col<size_t>& childMajorities, SplitInfo& splitInfo);
110 template<
typename Archive>
113 ar(CEREAL_NVP(sufficientStatistics));
120 arma::Mat<size_t> sufficientStatistics;
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
void EvaluateFitnessFunction(double &bestFitness, double &secondBestFitness) const
Given the points seen so far, evaluate the fitness function, returning the gain for the best possible...
Definition: hoeffding_categorical_split_impl.hpp:51
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t MajorityClass() const
Get the majority class seen so far.
Definition: hoeffding_categorical_split_impl.hpp:78
Definition: categorical_split_info.hpp:20
void serialize(Archive &ar, const uint32_t)
Serialize the categorical split.
Definition: hoeffding_categorical_split.hpp:111
void Split(arma::Col< size_t > &childMajorities, SplitInfo &splitInfo)
Gather the information for a split: get the labels of the child majorities, and initialize the SplitI...
Definition: hoeffding_categorical_split_impl.hpp:60
CategoricalSplitInfo SplitInfo
The type of split information required by the HoeffdingCategoricalSplit.
Definition: hoeffding_categorical_split.hpp:48
size_t NumChildren() const
Return the number of children, if the node were to split.
Definition: hoeffding_categorical_split.hpp:93
HoeffdingCategoricalSplit(const size_t numCategories=0, const size_t numClasses=0)
Create the HoeffdingCategoricalSplit given a number of categories for this dimension and a number of ...
Definition: hoeffding_categorical_split_impl.hpp:22
double MajorityProbability() const
Get the probability of the majority class given the points seen so far.
Definition: hoeffding_categorical_split_impl.hpp:90
This is the standard Hoeffding-bound categorical feature proposed in the paper below: ...
Definition: hoeffding_categorical_split.hpp:44
void Train(eT value, const size_t label)
Train on the given value with the given label.
Definition: hoeffding_categorical_split_impl.hpp:42