MeanSplit< BoundType, MatType > Class Template Reference

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

Classes

struct  SplitInfo
 An information about the partition. More...

 

Static Public Member Functions

template
<
typename
VecType
>
static bool AssignToLeftNode (const VecType &point, const SplitInfo &splitInfo)
 Indicates that a point should be assigned to the left subtree. More...

 
static size_t PerformSplit (MatType &data, const size_t begin, const size_t count, const SplitInfo &splitInfo)
 Perform the split process according to the information about the split. More...

 
static size_t PerformSplit (MatType &data, const size_t begin, const size_t count, const SplitInfo &splitInfo, std::vector< size_t > &oldFromNew)
 Perform the split process according to the information about the split and return the list of changed indices. More...

 
static bool SplitNode (const BoundType &bound, MatType &data, const size_t begin, const size_t count, SplitInfo &splitInfo)
 Find the partition of the node. 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 29 of file mean_split.hpp.

Member Function Documentation

◆ AssignToLeftNode()

static bool AssignToLeftNode ( const VecType &  point,
const SplitInfo splitInfo 
)
inlinestatic

Indicates that a point should be assigned to the left subtree.

Parameters
pointThe point that is being assigned.
splitInfoAn information about the split.

Definition at line 113 of file mean_split.hpp.

References MeanSplit< BoundType, MatType >::SplitInfo::splitDimension, and MeanSplit< BoundType, MatType >::SplitInfo::splitVal.

◆ PerformSplit() [1/2]

static size_t PerformSplit ( MatType &  data,
const size_t  begin,
const size_t  count,
const SplitInfo splitInfo 
)
inlinestatic

Perform the split process according to the information about the split.

This will order the dataset such that points that belong to the left subtree are on the left of the split column, and points from the right subtree are on the right side of the split column.

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.
splitInfoThe information about the split.

Definition at line 72 of file mean_split.hpp.

◆ PerformSplit() [2/2]

static size_t PerformSplit ( MatType &  data,
const size_t  begin,
const size_t  count,
const SplitInfo splitInfo,
std::vector< size_t > &  oldFromNew 
)
inlinestatic

Perform the split process according to the information about the split and return the list of changed indices.

This will order the dataset such that points that belong to the left subtree are on the left of the split column, and points from the right subtree are on the right side of the split column.

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.
splitInfoThe information about the split.
oldFromNewVector which will be filled with the old positions for each new point.

Definition at line 96 of file mean_split.hpp.

◆ SplitNode()

static bool SplitNode ( const BoundType &  bound,
MatType &  data,
const size_t  begin,
const size_t  count,
SplitInfo splitInfo 
)
static

Find the partition of the node.

This method fills up the dimension that will be used to split the node and the value according which the split will be performed.

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.
splitInfoAn information about the split. This information contains the dimension and the value.

The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/core/tree/binary_space_tree/mean_split.hpp