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,
70 const size_t observationsBeforeBinning = 100);
88 void Train(ObservationType value,
const size_t label);
112 void Split(arma::Col<size_t>& childMajorities, SplitInfo& splitInfo)
const;
120 size_t Bins()
const {
return bins; }
123 template<
typename Archive>
124 void serialize(Archive& ar,
const uint32_t );
128 arma::Col<ObservationType> observations;
130 arma::Col<size_t> labels;
133 arma::Col<ObservationType> splitPoints;
137 size_t observationsBeforeBinning;
142 arma::Mat<size_t> sufficientStatistics;
146 template<
typename FitnessFunction>
void EvaluateFitnessFunction(double &bestFitness, double &secondBestFitness) const
Evaluate the fitness function given what has been calculated so far.
Definition: hoeffding_numeric_split_impl.hpp:108
double MajorityProbability() const
Return the probability of the majority class.
Definition: hoeffding_numeric_split_impl.hpp:166
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
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...
Definition: hoeffding_numeric_split_impl.hpp:119
The HoeffdingNumericSplit class implements the numeric feature splitting strategy alluded to by Domin...
Definition: hoeffding_numeric_split.hpp:53
void Train(ObservationType value, const size_t label)
Train the HoeffdingNumericSplit on the given observed value (remember that this object only cares abo...
Definition: hoeffding_numeric_split_impl.hpp:52
NumericSplitInfo< ObservationType > SplitInfo
The splitting information type required by the HoeffdingNumericSplit.
Definition: hoeffding_numeric_split.hpp:57
void serialize(Archive &ar, const uint32_t)
Serialize the object.
Definition: hoeffding_numeric_split_impl.hpp:191
Definition: numeric_split_info.hpp:21
size_t MajorityClass() const
Return the majority class.
Definition: hoeffding_numeric_split_impl.hpp:137
size_t Bins() const
Return the number of bins.
Definition: hoeffding_numeric_split.hpp:120
HoeffdingNumericSplit(const size_t numClasses=0, const size_t bins=10, const size_t observationsBeforeBinning=100)
Create the HoeffdingNumericSplit class, and specify some basic parameters about how the binning shoul...
Definition: hoeffding_numeric_split_impl.hpp:21
size_t NumChildren() const
Return the number of children if this node splits on this feature.
Definition: hoeffding_numeric_split.hpp:106