mlpack
Namespaces | Functions
perform_split.hpp File Reference
This graph shows which files directly or indirectly include this file:

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...
 

Detailed Description

Author
Mikhail Lozhnikov

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.

Function Documentation

◆ PerformSplit() [1/2]

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.

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.

Parameters
dataThe dataset used by the binary space tree.
beginIndex of the starting point in the dataset that belongs to this node.
countNumber of points in this node.
splitInfoThe information about the split.

◆ PerformSplit() [2/2]

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.

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.

Parameters
dataThe dataset used by the binary space tree.
beginIndex of the starting point in the dataset that belongs to this node.
countNumber of points in this node.
splitInfoThe information about the split.
oldFromNewVector which will be filled with the old positions for each new point.