13 #ifndef MLPACK_CORE_TREE_BINARY_SPACE_TREE_RP_TREE_MEAN_SPLIT_HPP 14 #define MLPACK_CORE_TREE_BINARY_SPACE_TREE_RP_TREE_MEAN_SPLIT_HPP 32 template<
typename BoundType,
typename MatType = arma::mat>
87 return split::PerformSplit<MatType, RPTreeMeanSplit>(data, begin, count,
110 std::vector<size_t>& oldFromNew)
112 return split::PerformSplit<MatType, RPTreeMeanSplit>(data, begin, count,
113 splitInfo, oldFromNew);
122 template<
typename VecType>
126 return arma::dot(point - splitInfo.
mean, point - splitInfo.
mean) <=
139 static ElemType GetAveragePointDistance(MatType& data,
140 const arma::uvec& samples);
151 static bool GetDotMedian(
const MatType& data,
152 const arma::uvec& samples,
165 static bool GetMeanMedian(
const MatType& data,
166 const arma::uvec& samples,
167 arma::Col<ElemType>&
mean,
175 #include "rp_tree_mean_split_impl.hpp" 177 #endif // MLPACK_CORE_TREE_BINARY_SPACE_TREE_RP_TREE_MEAN_SPLIT_HPP Linear algebra utility functions, generally performed on matrices or vectors.
An information about the partition.
The core includes that mlpack expects; standard C++ includes and Armadillo.
ElemType splitVal
The value according to which the split will be performed.
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...
arma::Col< ElemType > mean
The mean of some sampled points.
This class splits a binary space tree.
static bool AssignToLeftNode(const VecType &point, const SplitInfo &splitInfo)
Indicates that a point should be assigned to the left subtree.
static bool SplitNode(const BoundType &, MatType &data, const size_t begin, const size_t count, SplitInfo &splitInfo)
Split the node according to the mean value in the dimension with maximum width.
MatType::elem_type ElemType
The element type held by the matrix type.
bool meanSplit
Indicates that we should use the mean split algorithm instead of the median 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.
arma::Col< ElemType > direction
The normal to the hyperplane that will split the node.