mlpack  master
Classes | Static Public Member Functions | List of all members
mlpack::tree::BestBinaryNumericSplit< FitnessFunction > Class Template Reference

The BestBinaryNumericSplit is a splitting function for decision trees that will exhaustively search a numeric dimension for the best binary split. More...

Classes

class  AuxiliarySplitInfo
 

Static Public Member Functions

template<typename ElemType >
static size_t CalculateDirection (const ElemType &point, const arma::Col< ElemType > &classProbabilities, const AuxiliarySplitInfo< ElemType > &)
 Given a point, calculate which child it should go to (left or right). More...
 
template<typename ElemType >
static size_t NumChildren (const arma::Col< ElemType > &, const AuxiliarySplitInfo< ElemType > &)
 Returns 2, since the binary split always has two children. More...
 
template<typename VecType >
static double SplitIfBetter (const double bestGain, const VecType &data, const arma::Row< size_t > &labels, const size_t numClasses, const size_t minimumLeafSize, arma::Col< typename VecType::elem_type > &classProbabilities, AuxiliarySplitInfo< typename VecType::elem_type > &aux)
 Check if we can split a node. More...
 

Detailed Description

template<typename FitnessFunction>
class mlpack::tree::BestBinaryNumericSplit< FitnessFunction >

The BestBinaryNumericSplit is a splitting function for decision trees that will exhaustively search a numeric dimension for the best binary split.

Template Parameters
FitnessFunctionFitness function to use to calculate gain.

Definition at line 22 of file best_binary_numeric_split.hpp.

Member Function Documentation

template<typename FitnessFunction >
template<typename ElemType >
static size_t mlpack::tree::BestBinaryNumericSplit< FitnessFunction >::CalculateDirection ( const ElemType &  point,
const arma::Col< ElemType > &  classProbabilities,
const AuxiliarySplitInfo< ElemType > &   
)
static

Given a point, calculate which child it should go to (left or right).

Parameters
pointPoint to calculate direction of.
classProbabilitiesAuxiliary information for the split.
aux(Unused) auxiliary information for the split.

Referenced by mlpack::tree::BestBinaryNumericSplit< FitnessFunction >::NumChildren().

template<typename FitnessFunction >
template<typename ElemType >
static size_t mlpack::tree::BestBinaryNumericSplit< FitnessFunction >::NumChildren ( const arma::Col< ElemType > &  ,
const AuxiliarySplitInfo< ElemType > &   
)
inlinestatic

Returns 2, since the binary split always has two children.

Definition at line 62 of file best_binary_numeric_split.hpp.

References mlpack::tree::BestBinaryNumericSplit< FitnessFunction >::CalculateDirection().

template<typename FitnessFunction >
template<typename VecType >
static double mlpack::tree::BestBinaryNumericSplit< FitnessFunction >::SplitIfBetter ( const double  bestGain,
const VecType &  data,
const arma::Row< size_t > &  labels,
const size_t  numClasses,
const size_t  minimumLeafSize,
arma::Col< typename VecType::elem_type > &  classProbabilities,
AuxiliarySplitInfo< typename VecType::elem_type > &  aux 
)
static

Check if we can split a node.

If we can split a node in a way that improves on 'bestGain', then we return the improved gain. Otherwise we return the value 'bestGain'. If a split is made, then classProbabilities and aux may be modified.

Parameters
bestGainBest gain seen so far (we'll only split if we find gain better than this).
dataThe dimension of data points to check for a split in.
numCategoriesNumber of categories in the categorical data.
labelsLabels for each point.
numClassesNumber of classes in the dataset.
minimumLeafSizeMinimum number of points in a leaf node for splitting.
classProbabilitiesClass probabilities vector, which may be filled with split information a successful split.
auxAuxiliary split information, which may be modified on a successful split.

The documentation for this class was generated from the following file: