14 #ifndef MLPACK_METHODS_HOEFFDING_TREES_HOEFFDING_NUMERIC_SPLIT_HPP 15 #define MLPACK_METHODS_HOEFFDING_TREES_HOEFFDING_NUMERIC_SPLIT_HPP 51 template<
typename FitnessFunction,
52 typename ObservationType =
double>
69 const size_t bins = 10,
88 void Train(ObservationType value,
const size_t label);
112 void Split(arma::Col<size_t>& childMajorities, SplitInfo& splitInfo)
const;
123 template<
typename Archive>
124 void Serialize(Archive& ar,
const unsigned int );
146 template<
typename FitnessFunction>
154 #include "hoeffding_numeric_split_impl.hpp" size_t samplesSeen
The number of samples we have seen so far.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t observationsBeforeBinning
The number of observations we must see before binning.
The HoeffdingNumericSplit class implements the numeric feature splitting strategy alluded to by Domin...
void Train(ObservationType value, const size_t label)
Train the HoeffdingNumericSplit on the given observed value (remember that this object only cares abo...
NumericSplitInfo< ObservationType > SplitInfo
The splitting information type required by the HoeffdingNumericSplit.
void Serialize(Archive &ar, const unsigned int)
Serialize the object.
void EvaluateFitnessFunction(double &bestFitness, double &secondBestFitness) const
Evaluate the fitness function given what has been calculated so far.
size_t bins
The number of bins.
void Split(arma::Col< size_t > &childMajorities, SplitInfo &splitInfo) const
Return the majority class of each child to be created, if a split on this dimension was performed...
size_t NumChildren() const
Return the number of children if this node splits on this feature.
arma::Col< ObservationType > splitPoints
The split points for the binning (length bins - 1).
double MajorityProbability() const
Return the probability of the majority class.
size_t Bins() const
Return the number of bins.
arma::Col< ObservationType > observations
Before binning, this holds the points we have seen so far.
size_t MajorityClass() const
Return the majority class.
HoeffdingNumericSplit(const size_t numClasses, const size_t bins=10, const size_t observationsBeforeBinning=100)
Create the HoeffdingNumericSplit class, and specify some basic parameters about how the binning shoul...
arma::Col< size_t > labels
This holds the labels of the points before binning.
arma::Mat< size_t > sufficientStatistics
After binning, this contains the sufficient statistics.