13 #ifndef MLPACK_METHODS_HOEFFDING_SPLIT_BINARY_NUMERIC_SPLIT_HPP 14 #define MLPACK_METHODS_HOEFFDING_SPLIT_BINARY_NUMERIC_SPLIT_HPP 45 template<
typename FitnessFunction,
46 typename ObservationType =
double>
74 void Train(ObservationType value,
const size_t label);
90 double& secondBestFitness);
102 void Split(arma::Col<size_t>& childMajorities,
SplitInfo& splitInfo);
110 template<
typename Archive>
111 void Serialize(Archive& ar,
const unsigned int );
115 std::multimap<ObservationType, size_t> sortedElements;
117 arma::Col<size_t> classCounts;
120 ObservationType bestSplit;
127 template<
typename FitnessFunction>
134 #include "binary_numeric_split_impl.hpp" void Serialize(Archive &ar, const unsigned int)
Serialize the object.
double MajorityProbability() const
The probability of the majority class given the points seen so far.
Linear algebra utility functions, generally performed on matrices or vectors.
BinaryNumericSplitInfo< ObservationType > SplitInfo
The splitting information required by the BinaryNumericSplit.
void Train(ObservationType value, const size_t label)
Train on the given value with the given label.
The BinaryNumericSplit class implements the numeric feature splitting strategy devised by Gama...
size_t MajorityClass() const
The majority class of the points seen so far.
void EvaluateFitnessFunction(double &bestFitness, double &secondBestFitness)
Given the points seen so far, evaluate the fitness function, returning the best possible gain of a bi...
BinaryNumericSplit(const size_t numClasses)
Create the BinaryNumericSplit object with the given number of classes.
void Split(arma::Col< size_t > &childMajorities, SplitInfo &splitInfo)
Given that a split should happen, return the majority classes of the (two) children and an initialize...
size_t NumChildren() const