The RandomBinaryNumericSplit is a splitting function for decision trees that will split based on a randomly selected point between the minimum and maximum value of the numerical dimension.
More...
#include <random_binary_numeric_split.hpp>
|
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, const bool splitIfBetterGain=false) |
| Check if we can split a node. More...
|
|
template<bool UseWeights, typename VecType , typename WeightVecType > |
static double | SplitIfBetter (const double bestGain, const VecType &data, const arma::rowvec &responses, const WeightVecType &weights, const size_t minimumLeafSize, const double minimumGainSplit, double &splitInfo, AuxiliarySplitInfo &aux, const bool splitIfBetterGain=false) |
| Check if we can split a node. More...
|
|
static size_t | NumChildren (const double &, const AuxiliarySplitInfo &) |
| Returns 2, since the binary split always has two children. More...
|
|
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...
|
|
template<typename FitnessFunction>
class mlpack::tree::RandomBinaryNumericSplit< FitnessFunction >
The RandomBinaryNumericSplit is a splitting function for decision trees that will split based on a randomly selected point between the minimum and maximum value of the numerical dimension.
- Template Parameters
-
FitnessFunction | Fitness function to use to calculate gain. |
◆ CalculateDirection()
template<typename FitnessFunction >
template<typename ElemType >
Given a point, calculate which child it should go to (left or right).
- Parameters
-
point | Point to calculate direction of. |
splitInfo | Auxiliary information for the split. |
* | (aux) Auxiliary information for the split (Unused). |
◆ NumChildren()
template<typename FitnessFunction >
Returns 2, since the binary split always has two children.
- Parameters
-
splitInfo | Auxiliary information for the split. |
aux | Auxiliary split information, which may be modified on a successful split. |
◆ SplitIfBetter() [1/2]
template<typename FitnessFunction >
template<bool UseWeights, typename VecType , typename WeightVecType >
double mlpack::tree::RandomBinaryNumericSplit< FitnessFunction >::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, |
|
|
const bool |
splitIfBetterGain = false |
|
) |
| |
|
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.
@article{10.1007/s10994-006-6226-1,
author = {Geurts, Pierre and Ernst, Damien and Wehenkel, Louis},
title = {Extremely Randomized Trees},
year = {2006},
issue_date = {April 2006},
publisher = {Kluwer Academic Publishers},
address = {USA},
volume = {63},
number = {1},
issn = {0885-6125},
url = {https:
doi = {10.1007/s10994-006-6226-1},
journal = {Mach. Learn.},
month = apr,
pages = {3–42},
numpages = {40},
}
- Parameters
-
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. |
splitIfBetterGain | When set to true, it will split only when gain is better than the current best gain. Otherwise, it always makes a split regardless of gain. |
◆ SplitIfBetter() [2/2]
template<typename FitnessFunction >
template<bool UseWeights, typename VecType , typename WeightVecType >
double mlpack::tree::RandomBinaryNumericSplit< FitnessFunction >::SplitIfBetter |
( |
const double |
bestGain, |
|
|
const VecType & |
data, |
|
|
const arma::rowvec & |
responses, |
|
|
const WeightVecType & |
weights, |
|
|
const size_t |
minimumLeafSize, |
|
|
const double |
minimumGainSplit, |
|
|
double & |
splitInfo, |
|
|
AuxiliarySplitInfo & |
aux, |
|
|
const bool |
splitIfBetterGain = false |
|
) |
| |
|
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.
- Parameters
-
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. |
splitIfBetterGain | When set to true, it will split only when gain is better than the current best gain. Otherwise, it always makes a split regardless of gain. |
The documentation for this class was generated from the following files: