13 #ifndef MLPACK_CORE_TREE_BINARY_SPACE_TREE_VANTAGE_POINT_SPLIT_HPP 14 #define MLPACK_CORE_TREE_BINARY_SPACE_TREE_VANTAGE_POINT_SPLIT_HPP 29 template<
typename BoundType,
30 typename MatType = arma::mat,
31 size_t MaxNumSamples = 100>
54 template<
typename VecType>
55 SplitInfo(
const MetricType& metric,
const VecType& vantagePoint,
57 vantagePoint(vantagePoint),
74 static bool SplitNode(
const BoundType& bound,
97 return split::PerformSplit<MatType, VantagePointSplit>(data, begin, count,
120 std::vector<size_t>& oldFromNew)
122 return split::PerformSplit<MatType, VantagePointSplit>(data, begin, count,
123 splitInfo, oldFromNew);
135 template<
typename VecType>
161 static void SelectVantagePoint(
const MetricType&
metric,
173 #include "vantage_point_split_impl.hpp" 175 #endif // MLPACK_CORE_TREE_BINARY_SPACE_TREE_VANTAGE_POINT_SPLIT_HPP BoundType::MetricType MetricType
The bounding shape type.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
static bool AssignToLeftNode(const VecType &point, const SplitInfo &splitInfo)
Indicates that a point should be assigned to the left subtree.
SplitInfo(const MetricType &metric, const VecType &vantagePoint, ElemType mu)
MatType::elem_type ElemType
The matrix element type.
A struct that contains an information about the split.
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.
The class splits a binary space partitioning tree node according to the median distance to the vantag...
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.
arma::Col< ElemType > vantagePoint
The vantage point.
Miscellaneous math random-related routines.
ElemType mu
The median distance according to which the node will be split.
const MetricType * metric
An instance of the MetricType class.
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...