15 #ifndef __MLPACK_METHODS_HOEFFDING_TREES_HOEFFDING_CATEGORICAL_SPLIT_HPP
16 #define __MLPACK_METHODS_HOEFFDING_TREES_HOEFFDING_CATEGORICAL_SPLIT_HPP
45 template<
typename FitnessFunction>
60 const size_t numClasses);
69 const size_t numClasses,
79 void Train(eT value,
const size_t label);
104 void Split(arma::Col<size_t>& childMajorities, SplitInfo& splitInfo);
112 template<
typename Archive>
129 #include "hoeffding_categorical_split_impl.hpp"
void Serialize(Archive &ar, const unsigned int)
Serialize the categorical split.
Linear algebra utility functions, generally performed on matrices or vectors.
FirstShim< T > CreateNVP(T &t, const std::string &name, typename boost::enable_if< HasSerialize< T >>::type *=0)
Call this function to produce a name-value pair; this is similar to BOOST_SERIALIZATION_NVP(), but should be used for types that have a Serialize() function (or contain a type that has a Serialize() function) instead of a serialize() function.
double MajorityProbability() const
Get the probability of the majority class given the points seen so far.
HoeffdingCategoricalSplit(const size_t numCategories, const size_t numClasses)
Create the HoeffdingCategoricalSplit given a number of categories for this dimension and a number of ...
arma::Mat< size_t > sufficientStatistics
The sufficient statistics for all points seen so far.
void EvaluateFitnessFunction(double &bestFitness, double &secondBestFitness) const
Given the points seen so far, evaluate the fitness function, returning the gain for the best possible...
size_t NumChildren() const
Return the number of children, if the node were to split.
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...
CategoricalSplitInfo SplitInfo
The type of split information required by the HoeffdingCategoricalSplit.
size_t MajorityClass() const
Get the majority class seen so far.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
This is the standard Hoeffding-bound categorical feature proposed in the paper below: ...
void Train(eT value, const size_t label)
Train on the given value with the given label.