mlpack
|
Go to the source code of this file.
Namespaces | |
mlpack | |
Linear algebra utility functions, generally performed on matrices or vectors. | |
mlpack::tree | |
Trees and tree-building procedures. | |
Functions | |
template<typename MatType , typename SplitType > | |
size_t | mlpack::tree::split::PerformSplit (MatType &data, const size_t begin, const size_t count, const typename SplitType::SplitInfo &splitInfo) |
This function implements the default split behavior i.e. More... | |
template<typename MatType , typename SplitType > | |
size_t | mlpack::tree::split::PerformSplit (MatType &data, const size_t begin, const size_t count, const typename SplitType::SplitInfo &splitInfo, std::vector< size_t > &oldFromNew) |
This function implements the default split behavior i.e. More... | |
This file contains functions that implement the default binary split behavior. The functions perform the actual splitting. 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.
mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.
size_t mlpack::tree::split::PerformSplit | ( | MatType & | data, |
const size_t | begin, | ||
const size_t | count, | ||
const typename SplitType::SplitInfo & | splitInfo | ||
) |
This function implements the default split behavior i.e.
it rearranges points according to the split information. The SplitType::AssignToLeftNode() function is used in order to determine the child that contains any particular point.
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. |
size_t mlpack::tree::split::PerformSplit | ( | MatType & | data, |
const size_t | begin, | ||
const size_t | count, | ||
const typename SplitType::SplitInfo & | splitInfo, | ||
std::vector< size_t > & | oldFromNew | ||
) |
This function implements the default split behavior i.e.
it rearranges points according to the split information. The SplitType::AssignToLeftNode() function is used in order to determine the child that contains any particular point. The function takes care of indices and returns the list of changed indices.
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. |