The class splits a binary space partitioning tree node according to the median distance to the vantage point.
More...
#include <vantage_point_split.hpp>
|
typedef MatType::elem_type | ElemType |
| The matrix element type.
|
|
typedef BoundType::MetricType | MetricType |
| The bounding shape type.
|
|
|
static bool | SplitNode (const BoundType &bound, MatType &data, const size_t begin, const size_t count, SplitInfo &splitInfo) |
| Split the node according to the distance to a vantage point. 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...
|
|
template<typename VecType > |
static bool | AssignToLeftNode (const VecType &point, const SplitInfo &splitInfo) |
| Indicates that a point should be assigned to the left subtree. More...
|
|
template<typename BoundType, typename MatType = arma::mat, size_t MaxNumSamples = 100>
class mlpack::tree::VantagePointSplit< BoundType, MatType, MaxNumSamples >
The class splits a binary space partitioning tree node according to the median distance to the vantage point.
Thus points that are closer to the vantage point belong to the left subtree and points that are farther from the vantage point belong to the right subtree.
◆ AssignToLeftNode()
template<typename BoundType , typename MatType = arma::mat, size_t MaxNumSamples = 100>
template<typename VecType >
Indicates that a point should be assigned to the left subtree.
This method returns true if a point should be assigned to the left subtree, i.e., if the distance from the point to the vantage point is less then the median value. Otherwise it returns false.
- Parameters
-
point | The point that is being assigned. |
splitInfo | An information about the split. |
◆ PerformSplit() [1/2]
template<typename BoundType , typename MatType = arma::mat, size_t MaxNumSamples = 100>
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
-
data | The dataset used by the binary space tree. |
begin | Index of the starting point in the dataset that belongs to this node. |
count | Number of points in this node. |
splitInfo | The information about the split. |
◆ PerformSplit() [2/2]
template<typename BoundType , typename MatType = arma::mat, size_t MaxNumSamples = 100>
static size_t mlpack::tree::VantagePointSplit< BoundType, MatType, MaxNumSamples >::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
-
data | The dataset used by the binary space tree. |
begin | Index of the starting point in the dataset that belongs to this node. |
count | Number of points in this node. |
splitInfo | The information about the split. |
oldFromNew | Vector which will be filled with the old positions for each new point. |
◆ SplitNode()
template<typename BoundType , typename MatType , size_t MaxNumSamples>
Split the node according to the distance to a vantage point.
- Parameters
-
bound | The bound used for this node. |
data | The dataset used by the binary space tree. |
begin | Index of the starting point in the dataset that belongs to this node. |
count | Number of points in this node. |
splitInfo | An information about the split. This information contains the vantage point and the median distance to the vantage point. |
The documentation for this class was generated from the following files: