KHC-tree, a binary space-partitioning tree. More...
#include <shark/Models/Trees/KHCTree.h>
Public Types | |
typedef IndexedIterator< typename boost::range_iterator< Container const >::type > | const_iterator |
Public Member Functions | |
KHCTree (Container const &points, kernel_type const *kernel, TreeConstruction tc=TreeConstruction()) | |
double | squaredDistanceLowerBound (value_type const &reference) const |
Protected Member Functions | |
KHCTree (KHCTree *parent, std::size_t *list, std::size_t size) | |
(internal) construction of a non-root node More... | |
template<class Range > | |
void | buildTree (TreeConstruction tc, Range &points) |
template<class Range > | |
void | calculateNormal (Range const &samples) |
double | funct (value_type const &reference) const |
function describing the separating hyperplane More... | |
Protected Attributes | |
kernel_type const * | mep_kernel |
kernel function More... | |
const_iterator | mep_positive |
"positive" side cluster center More... | |
const_iterator | mep_negative |
"negative" side cluster center More... | |
double | m_normalInvNorm |
one divided by squared distance between "positive" and "negative" cluster center More... | |
KHC-tree, a binary space-partitioning tree.
Since the KHCTree needs direct access to the elements, it's template parameter is not the actual point type But the Range, the points are stored in. Be aware that this range should be a View when a Dataset is used as storage, since during construction, the KHC-Tree needs random access to the elements.
typedef IndexedIterator<typename boost::range_iterator<Container const>::type> shark::KHCTree< Container, CuttingAccuracy >::const_iterator |
|
inline |
Construct the tree from data. It is assumed that the container exceeds the lifetime of the KHCTree (which holds only references to the points), and that the memory locations of the points remain unchanged.
Definition at line 88 of file KHCTree.h.
References shark::KHCTree< Container, CuttingAccuracy >::buildTree(), shark::BinaryTree< Container::value_type >::m_size, and shark::BinaryTree< Container::value_type >::mp_indexList.
|
inlineprotected |
|
inlineprotected |
(internal) construction method: median-cuts of the dimension with widest spread
Definition at line 146 of file KHCTree.h.
References shark::KHCTree< Container, CuttingAccuracy >::calculateNormal(), shark::BinaryTree< Container::value_type >::m_nodes, shark::BinaryTree< Container::value_type >::m_size, shark::TreeConstruction::maxBucketSize(), and shark::TreeConstruction::maxDepth().
Referenced by shark::KHCTree< Container, CuttingAccuracy >::KHCTree().
|
inlineprotected |
Definition at line 199 of file KHCTree.h.
References shark::batchSize(), shark::AbstractKernelFunction< InputTypeT >::featureDistanceSqr(), shark::KHCTree< Container, CuttingAccuracy >::m_normalInvNorm, shark::KHCTree< Container, CuttingAccuracy >::mep_kernel, shark::KHCTree< Container, CuttingAccuracy >::mep_negative, and shark::KHCTree< Container, CuttingAccuracy >::mep_positive.
Referenced by shark::KHCTree< Container, CuttingAccuracy >::buildTree().
|
inlineprotected |
function describing the separating hyperplane
Definition at line 220 of file KHCTree.h.
References shark::AbstractKernelFunction< InputTypeT >::eval(), shark::KHCTree< Container, CuttingAccuracy >::m_normalInvNorm, shark::KHCTree< Container, CuttingAccuracy >::mep_kernel, shark::KHCTree< Container, CuttingAccuracy >::mep_negative, and shark::KHCTree< Container, CuttingAccuracy >::mep_positive.
|
inline |
Definition at line 112 of file KHCTree.h.
References shark::BinaryTree< InputT >::m_nodes, shark::BinaryTree< InputT >::m_size, shark::BinaryTree< InputT >::mep_parent, shark::BinaryTree< Container::value_type >::mep_parent, shark::BinaryTree< InputT >::mp_indexList, shark::BinaryTree< InputT >::mp_left, and shark::BinaryTree< InputT >::mp_right.
|
protected |
one divided by squared distance between "positive" and "negative" cluster center
Definition at line 237 of file KHCTree.h.
Referenced by shark::KHCTree< Container, CuttingAccuracy >::calculateNormal(), and shark::KHCTree< Container, CuttingAccuracy >::funct().
|
protected |
kernel function
Definition at line 228 of file KHCTree.h.
Referenced by shark::KHCTree< Container, CuttingAccuracy >::calculateNormal(), and shark::KHCTree< Container, CuttingAccuracy >::funct().
|
protected |
"negative" side cluster center
Definition at line 234 of file KHCTree.h.
Referenced by shark::KHCTree< Container, CuttingAccuracy >::calculateNormal(), and shark::KHCTree< Container, CuttingAccuracy >::funct().
|
protected |
"positive" side cluster center
Definition at line 231 of file KHCTree.h.
Referenced by shark::KHCTree< Container, CuttingAccuracy >::calculateNormal(), and shark::KHCTree< Container, CuttingAccuracy >::funct().