mlpack  2.0.1
Static Public Member Functions | Static Private Member Functions | List of all members
mlpack::tree::MeanSplit< BoundType, MatType > Class Template Reference

A binary space partitioning tree node is split into its left and right child. More...

Static Public Member Functions

static bool SplitNode (const BoundType &bound, MatType &data, const size_t begin, const size_t count, size_t &splitCol)
 Split the node according to the mean value in the dimension with maximum width. More...
 
static bool SplitNode (const BoundType &bound, MatType &data, const size_t begin, const size_t count, size_t &splitCol, std::vector< size_t > &oldFromNew)
 Split the node according to the mean value in the dimension with maximum width and return a list of changed indices. More...
 

Static Private Member Functions

static size_t PerformSplit (MatType &data, const size_t begin, const size_t count, const size_t splitDimension, const double splitVal)
 Reorder the dataset into two parts such that they lie on either side of splitCol. More...
 
static size_t PerformSplit (MatType &data, const size_t begin, const size_t count, const size_t splitDimension, const double splitVal, std::vector< size_t > &oldFromNew)
 Reorder the dataset into two parts such that they lie on either side of splitCol. More...
 

Detailed Description

template<typename BoundType, typename MatType = arma::mat>
class mlpack::tree::MeanSplit< BoundType, MatType >

A binary space partitioning tree node is split into its left and right child.

The split is done in the dimension that has the maximum width. The points are divided into two parts based on the mean in this dimension.

Definition at line 30 of file mean_split.hpp.

Member Function Documentation

◆ PerformSplit() [1/2]

template<typename BoundType , typename MatType = arma::mat>
static size_t mlpack::tree::MeanSplit< BoundType, MatType >::PerformSplit ( MatType &  data,
const size_t  begin,
const size_t  count,
const size_t  splitDimension,
const double  splitVal 
)
staticprivate

Reorder the dataset into two parts such that they lie on either side of splitCol.

Parameters
dataThe dataset used by the binary space tree.
beginIndex of the starting point in the dataset that belongs to this node.
countNumber of points in this node.
splitDimensionThe dimension to split the node on.
splitValThe split in dimension splitDimension is based on this value.

◆ PerformSplit() [2/2]

template<typename BoundType , typename MatType = arma::mat>
static size_t mlpack::tree::MeanSplit< BoundType, MatType >::PerformSplit ( MatType &  data,
const size_t  begin,
const size_t  count,
const size_t  splitDimension,
const double  splitVal,
std::vector< size_t > &  oldFromNew 
)
staticprivate

Reorder the dataset into two parts such that they lie on either side of splitCol.

Also returns a list of changed indices.

Parameters
dataThe dataset used by the binary space tree.
beginIndex of the starting point in the dataset that belongs to this node.
countNumber of points in this node.
splitDimensionThe dimension to split the node on.
splitValThe split in dimension splitDimension is based on this value.
oldFromNewVector which will be filled with the old positions for each new point.

◆ SplitNode() [1/2]

template<typename BoundType , typename MatType = arma::mat>
static bool mlpack::tree::MeanSplit< BoundType, MatType >::SplitNode ( const BoundType &  bound,
MatType &  data,
const size_t  begin,
const size_t  count,
size_t &  splitCol 
)
static

Split the node according to the mean value in the dimension with maximum width.

Parameters
boundThe bound used for this node.
dataThe dataset used by the binary space tree.
beginIndex of the starting point in the dataset that belongs to this node.
countNumber of points in this node.
splitDimensionThis will be filled with the dimension the node is to be split on.
splitColThe index at which the dataset is divided into two parts after the rearrangement.

◆ SplitNode() [2/2]

template<typename BoundType , typename MatType = arma::mat>
static bool mlpack::tree::MeanSplit< BoundType, MatType >::SplitNode ( const BoundType &  bound,
MatType &  data,
const size_t  begin,
const size_t  count,
size_t &  splitCol,
std::vector< size_t > &  oldFromNew 
)
static

Split the node according to the mean value in the dimension with maximum width and return a list of changed indices.

Parameters
boundThe bound used for this node.
dataThe dataset used by the binary space tree.
beginIndex of the starting point in the dataset that belongs to this node.
countNumber of points in this node.
splitDimensionThis will be filled with the dimension the node is to be split on.
splitColThe index at which the dataset is divided into two parts after the rearrangement.
oldFromNewVector which will be filled with the old positions for each new point.

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