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 double &splitInfo, const AuxiliarySplitInfo &) |
| Given a point, calculate which child it should go to (left or right). More... | |
| static size_t | NumChildren (const double &, const AuxiliarySplitInfo &) |
| Returns 2, since the binary split always has two children. More... | |
| template<bool UseWeights, typename VecType , typename WeightVecType > | |
| static double | SplitIfBetter (const double bestGain, const VecType &data, const arma::Row< size_t > &labels, const size_t numClasses, const WeightVecType &weights, const size_t minimumLeafSize, const double minimumGainSplit, arma::vec &splitInfo, AuxiliarySplitInfo &aux) |
| Check if we can split a node. More... | |
| template<bool UseWeights, typename VecType , typename ResponsesType , typename WeightVecType > | |
| static std::enable_if< !HasOptimizedBinarySplitForms< FitnessFunction, UseWeights >::value, double >::type | SplitIfBetter (const double bestGain, const VecType &data, const ResponsesType &responses, const WeightVecType &weights, const size_t minimumLeafSize, const double minimumGainSplit, double &splitInfo, AuxiliarySplitInfo &aux, FitnessFunction &fitnessFunction) |
| Check if we can split a node. More... | |
| template<bool UseWeights, typename VecType , typename ResponsesType , typename WeightVecType > | |
| static std::enable_if< HasOptimizedBinarySplitForms< FitnessFunction, UseWeights >::value, double >::type | SplitIfBetter (const double bestGain, const VecType &data, const ResponsesType &responses, const WeightVecType &weights, const size_t minimumLeafSize, const double minimumGainSplit, double &splitInfo, AuxiliarySplitInfo &, FitnessFunction &fitnessFunction) |
| Check if we can split a node. More... | |
The BestBinaryNumericSplit is a splitting function for decision trees that will exhaustively search a numeric dimension for the best binary split.
| FitnessFunction | Fitness function to use to calculate gain. |
Definition at line 49 of file best_binary_numeric_split.hpp.
|
static |
Given a point, calculate which child it should go to (left or right).
| point | Point to calculate direction of. |
| splitInfo | Auxiliary information for the split. |
| * | (aux) Auxiliary information for the split (Unused). |
|
inlinestatic |
Returns 2, since the binary split always has two children.
Definition at line 166 of file best_binary_numeric_split.hpp.
|
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 splitInfo and aux may be modified.
This overload is used only for classification tasks.
| bestGain | Best gain seen so far (we'll only split if we find gain better than this). |
| data | The dimension of data points to check for a split in. |
| labels | Labels for each point. |
| numClasses | Number of classes in the dataset. |
| weights | Weights associated with labels. |
| minimumLeafSize | Minimum number of points in a leaf node for splitting. |
| minimumGainSplit | Minimum gain split. |
| splitInfo | Stores split information on a successful split. |
| aux | Auxiliary split information, which may be modified on a successful split. |
|
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 splitInfo and aux may be modified.
This overload is used only for regression tasks.
| bestGain | Best gain seen so far (we'll only split if we find gain better than this). |
| data | The dimension of data points to check for a split in. |
| responses | Responses for each point. |
| weights | Weights associated with responses. |
| minimumLeafSize | Minimum number of points in a leaf node for splitting. |
| minimumGainSplit | Minimum gain split. |
| splitInfo | Stores split information on a successful split. |
| aux | Auxiliary split information, which may be modified on a successful split. |
| fitnessFunction | The FitnessFunction object instance. It it used to evaluate the gain for the split. |
|
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 splitInfo and aux may be modified.
This overload is specialized for any fitness function that implements BinaryScanInitialize(), BinaryStep() and BinaryGains() functions.
| bestGain | Best gain seen so far (we'll only split if we find gain better than this). |
| data | The dimension of data points to check for a split in. |
| responses | Responses for each point. |
| weights | Weights associated with responses. |
| minimumLeafSize | Minimum number of points in a leaf node for splitting. |
| minimumGainSplit | Minimum gain split. |
| splitInfo | Stores split information on a successful split. |
| aux | Auxiliary split information, which may be modified on a successful split. |