mlpack  master
Classes | Public Types | Static Public Member Functions | Static Private Member Functions | List of all members
mlpack::tree::RPTreeMaxSplit< BoundType, MatType > Class Template Reference

This class splits a node by a random hyperplane. More...

Classes

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

Public Types

typedef MatType::elem_type ElemType
 The element type held by the matrix type. 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 &, MatType &data, const size_t begin, const size_t count, SplitInfo &splitInfo)
 Split the node by a random hyperplane. More...
 

Static Private Member Functions

static bool GetSplitVal (const MatType &data, const size_t begin, const size_t count, const arma::Col< ElemType > &direction, ElemType &splitVal)
 This method finds the position of the hyperplane that will split the node. More...
 

Detailed Description

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

This class splits a node by a random hyperplane.

In order to choose the hyperplane we need to choose the normal to the hyperplane and the position of the hyperplane i.e. the scalar product of the normal and a point.

A point will be assigned to the left subtree if the product of this point and the normal is less or equal to the split value (i.e. the position of the hyperplane).

Definition at line 32 of file rp_tree_max_split.hpp.

Member Typedef Documentation

template<typename BoundType , typename MatType = arma::mat>
typedef MatType::elem_type mlpack::tree::RPTreeMaxSplit< BoundType, MatType >::ElemType

The element type held by the matrix type.

Definition at line 36 of file rp_tree_max_split.hpp.

Member Function Documentation

template<typename BoundType , typename MatType = arma::mat>
template<typename VecType >
static bool mlpack::tree::RPTreeMaxSplit< BoundType, MatType >::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 118 of file rp_tree_max_split.hpp.

References mlpack::tree::RPTreeMaxSplit< BoundType, MatType >::SplitInfo::direction, mlpack::tree::RPTreeMaxSplit< BoundType, MatType >::GetSplitVal(), and mlpack::tree::RPTreeMaxSplit< BoundType, MatType >::SplitInfo::splitVal.

template<typename BoundType , typename MatType = arma::mat>
static bool mlpack::tree::RPTreeMaxSplit< BoundType, MatType >::GetSplitVal ( const MatType &  data,
const size_t  begin,
const size_t  count,
const arma::Col< ElemType > &  direction,
ElemType splitVal 
)
staticprivate

This method finds the position of the hyperplane that will split the node.

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.
directionA random vector that is the normal to the hyperplane which will split the node.
splitValThe value according which the node will be split.

Referenced by mlpack::tree::RPTreeMaxSplit< BoundType, MatType >::AssignToLeftNode().

template<typename BoundType , typename MatType = arma::mat>
static size_t mlpack::tree::RPTreeMaxSplit< BoundType, MatType >::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
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.
splitInfoThe information about the split.

Definition at line 76 of file rp_tree_max_split.hpp.

template<typename BoundType , typename MatType = arma::mat>
static size_t mlpack::tree::RPTreeMaxSplit< BoundType, MatType >::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
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.
splitInfoThe information about the split.
oldFromNewVector which will be filled with the old positions for each new point.

Definition at line 101 of file rp_tree_max_split.hpp.

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

Split the node by a random hyperplane.

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 direction and the value.

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