mlpack  master
Classes | Static Public Member Functions | List of all members
mlpack::tree::MinimalCoverageSweep< SplitPolicy > Class Template Reference

The MinimalCoverageSweep class finds a partition along which we can split a node according to the coverage of two resulting nodes. More...

Classes

struct  SweepCost
 A struct that provides the type of the sweep cost. More...
 

Static Public Member Functions

template<typename TreeType , typename ElemType >
static bool CheckLeafSweep (const TreeType *node, const size_t cutAxis, const ElemType cut)
 Check if a leaf node can be split along the axis at the provided coordinate. More...
 
template<typename TreeType , typename ElemType >
static bool CheckNonLeafSweep (const TreeType *node, const size_t cutAxis, const ElemType cut)
 Check if an intermediate node can be split along the axis at the provided coordinate. More...
 
template<typename TreeType >
static TreeType::ElemType SweepLeafNode (const size_t axis, const TreeType *node, typename TreeType::ElemType &axisCut)
 Find a suitable partition of a leaf node along the provided axis. More...
 
template<typename TreeType >
static TreeType::ElemType SweepNonLeafNode (const size_t axis, const TreeType *node, typename TreeType::ElemType &axisCut)
 Find a suitable partition of a non-leaf node along the provided axis. More...
 

Detailed Description

template<typename SplitPolicy>
class mlpack::tree::MinimalCoverageSweep< SplitPolicy >

The MinimalCoverageSweep class finds a partition along which we can split a node according to the coverage of two resulting nodes.

The class finds a partition along a given axis. Moreover, the class evaluates the cost of each split. The cost is proportional to the total coverage of resulting nodes. If the resulting nodes are overflowed the maximum cost is returned.

Template Parameters
SplitPolicyThe class that provides rules for inserting children of a node that is being split into two new subtrees.

Definition at line 30 of file minimal_coverage_sweep.hpp.

Member Function Documentation

template<typename SplitPolicy >
template<typename TreeType , typename ElemType >
static bool mlpack::tree::MinimalCoverageSweep< SplitPolicy >::CheckLeafSweep ( const TreeType *  node,
const size_t  cutAxis,
const ElemType  cut 
)
static

Check if a leaf node can be split along the axis at the provided coordinate.

Parameters
nodeThe node that is being split.
cutAxisThe axis that we want to check.
cutThe coordinate that we want to check.
template<typename SplitPolicy >
template<typename TreeType , typename ElemType >
static bool mlpack::tree::MinimalCoverageSweep< SplitPolicy >::CheckNonLeafSweep ( const TreeType *  node,
const size_t  cutAxis,
const ElemType  cut 
)
static

Check if an intermediate node can be split along the axis at the provided coordinate.

Parameters
nodeThe node that is being split.
cutAxisThe axis that we want to check.
cutThe coordinate that we want to check.
template<typename SplitPolicy >
template<typename TreeType >
static TreeType::ElemType mlpack::tree::MinimalCoverageSweep< SplitPolicy >::SweepLeafNode ( const size_t  axis,
const TreeType *  node,
typename TreeType::ElemType &  axisCut 
)
static

Find a suitable partition of a leaf node along the provided axis.

The method returns the cost of the split.

Parameters
axisThe axis along which we are finding a partition.
nodeThe node that is being split.
axisCutThe coordinate at which the node may be split.
template<typename SplitPolicy >
template<typename TreeType >
static TreeType::ElemType mlpack::tree::MinimalCoverageSweep< SplitPolicy >::SweepNonLeafNode ( const size_t  axis,
const TreeType *  node,
typename TreeType::ElemType &  axisCut 
)
static

Find a suitable partition of a non-leaf node along the provided axis.

The method returns the cost of the split.

Parameters
axisThe axis along which we are finding a partition.
nodeThe node that is being split.
axisCutThe coordinate at which the node may be split.

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