12 #ifndef MLPACK_CORE_TREE_SPILL_TREE_HYPERPLANE_HPP 13 #define MLPACK_CORE_TREE_SPILL_TREE_HYPERPLANE_HPP 29 template<
typename BoundT,
typename ProjVectorT>
70 template<
typename VecType>
74 if (splitVal == DBL_MAX)
76 return projVect.Project(point) -
splitVal;
85 template<
typename VecType>
86 bool Left(
const VecType& point,
98 template<
typename VecType>
99 bool Right(
const VecType& point,
110 bool Left(
const BoundType& bound)
const 112 if (splitVal == DBL_MAX)
114 return projVect.Project(bound).Hi() <=
splitVal;
122 bool Right(
const BoundType& bound)
const 124 if (splitVal == DBL_MAX)
126 return projVect.Project(bound).Lo() >
splitVal;
132 template<
typename Archive>
143 template<
typename MetricType>
150 template<
typename MetricType>
double Project(const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Project the given point on the projection vector and subtract the split value.
HyperplaneBase()
Empty Constructor.
AxisParallelProjVector defines an axis-parallel projection vector.
Linear algebra utility functions, generally performed on matrices or vectors.
bool Left(const BoundType &bound) const
Determine if the given bound is to the left of the hyperplane.
The core includes that mlpack expects; standard C++ includes and Armadillo.
FirstShim< T > CreateNVP(T &t, const std::string &name, typename std::enable_if_t< HasSerialize< T >::value > *=0)
Call this function to produce a name-value pair; this is similar to BOOST_SERIALIZATION_NVP(), but should be used for types that have a Serialize() function (or contain a type that has a Serialize() function) instead of a serialize() function.
ProjVectorType projVect
Projection vector.
HyperplaneBase defines a splitting hyperplane based on a projection vector and projection value...
ProjVector defines a general projection vector (not necessarily axis-parallel).
HyperplaneBase(const ProjVectorType &projVect, double splitVal)
Create the hyperplane with the specified projection vector and split value.
bool Right(const BoundType &bound) const
Determine if the given bound is to the right of the hyperplane.
double splitVal
Projection value that determines the decision boundary.
BoundT BoundType
Useful typedef for the bound type.
bool Right(const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Determine if the given point is to the right of the hyperplane, this means if the projection over the...
void Serialize(Archive &ar, const unsigned int)
Serialization.
ProjVectorT ProjVectorType
Useful typedef for the projection vector type.
bool Left(const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Determine if the given point is to the left of the hyperplane, this means if the projection over the ...
If value == true, then VecType is some sort of Armadillo vector or subview.
typename enable_if< B, T >::type enable_if_t