shark::TreeConstruction Class Reference

Stopping criteria for tree construction. More...

#include <shark/Models/Trees/BinaryTree.h>

Public Member Functions

 TreeConstruction ()
 Default constructor: only stop at trivial leaves. More...
 
 TreeConstruction (TreeConstruction const &other)
 Copy constructor. More...
 
 TreeConstruction (unsigned int maxDepth, unsigned int maxBucketSize)
 Constructor. More...
 
TreeConstruction nextDepthLevel () const
 return a TreeConstruction object with maxDepth reduced by one More...
 
unsigned int maxDepth () const
 return maximum depth of the tree More...
 
unsigned int maxBucketSize () const
 return maximum "size" of a leaf node More...
 

Protected Attributes

unsigned int m_maxDepth
 maximum depth of the tree More...
 
unsigned int m_maxBucketSize
 maximum "size" of a leaf node More...
 

Detailed Description

Stopping criteria for tree construction.

Conditions for automatic tree construction. The data structure allows to specify a maximum bucket size (number of instances represented by a leaf), and a maximum tree depth.
Note: If a data instance appears more often in a dataset than specified by the maximum bucket size then this condition will be violated; this is because a space partitioning tree has no means of separating a single point.

Definition at line 65 of file BinaryTree.h.

Constructor & Destructor Documentation

◆ TreeConstruction() [1/3]

shark::TreeConstruction::TreeConstruction ( )
inline

Default constructor: only stop at trivial leaves.

Definition at line 69 of file BinaryTree.h.

Referenced by nextDepthLevel().

◆ TreeConstruction() [2/3]

shark::TreeConstruction::TreeConstruction ( TreeConstruction const &  other)
inline

Copy constructor.

Definition at line 75 of file BinaryTree.h.

◆ TreeConstruction() [3/3]

shark::TreeConstruction::TreeConstruction ( unsigned int  maxDepth,
unsigned int  maxBucketSize 
)
inline

Constructor.

Parameters
maxDepthstop as soon as the given tree depth is reached (zero means unrestricted)
maxBucketSizestop as soon as a node holds at most the bucket size of data points (zero means unrestricted)

Definition at line 84 of file BinaryTree.h.

Member Function Documentation

◆ maxBucketSize()

unsigned int shark::TreeConstruction::maxBucketSize ( ) const
inline

◆ maxDepth()

unsigned int shark::TreeConstruction::maxDepth ( ) const
inline

◆ nextDepthLevel()

TreeConstruction shark::TreeConstruction::nextDepthLevel ( ) const
inline

return a TreeConstruction object with maxDepth reduced by one

Definition at line 91 of file BinaryTree.h.

References m_maxBucketSize, m_maxDepth, and TreeConstruction().

Member Data Documentation

◆ m_maxBucketSize

unsigned int shark::TreeConstruction::m_maxBucketSize
protected

maximum "size" of a leaf node

Definition at line 108 of file BinaryTree.h.

Referenced by maxBucketSize(), and nextDepthLevel().

◆ m_maxDepth

unsigned int shark::TreeConstruction::m_maxDepth
protected

maximum depth of the tree

Definition at line 105 of file BinaryTree.h.

Referenced by maxDepth(), and nextDepthLevel().


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