Go to the documentation of this file.
14 #ifndef MLPACK_CORE_TREE_EXAMPLE_TREE_HPP
15 #define MLPACK_CORE_TREE_EXAMPLE_TREE_HPP
53 template<
typename MetricType = metric::LMetric<2, true>,
54 typename StatisticType = EmptyStatistic,
55 typename MatType = arma::mat>
126 const StatisticType&
Stat()
const;
math::Range RangeDistance(const ExampleTree &other) const
Return both the minimum and maximum distances between this node and another node as a math::Range obj...
double MaxDistance(const MatType &point) const
Return the maximum distance between this node and a point.
void Centroid(arma::vec ¢roid) const
Fill the given vector with the center of the node.
size_t Descendant(const size_t i) const
Get the index of a particular descendant point.
size_t NumDescendants() const
Get the number of descendant points.
ExampleTree(const MatType &dataset, MetricType &metric)
This constructor will build the tree given a dataset and an instantiated metric.
double MaxDistance(const ExampleTree &other) const
Return the maximum distance between this node and another node.
math::Range RangeDistance(const MatType &point) const
Return both the minimum and maximum distances between this node and a point as a math::Range object.
double FurthestDescendantDistance() const
Get the distance from the center of the node to the furthest descendant point of this node.
size_t Point(const size_t i) const
Return the index of a particular point of this node.
MetricType & Metric()
Modify the instantiated metric for this node.
size_t NumPoints() const
Return the number of points held in this node.
Linear algebra utility functions, generally performed on matrices or vectors.
ExampleTree * Parent() const
Return the parent node (NULL if this is the root of the tree).
size_t NumChildren() const
Return the number of children of this node.
double MinDistance(const MatType &point) const
Return the minimum distance between this node and a point.
double MinDistance(const ExampleTree &other) const
Return the minimum distance between this node and another node.
const ExampleTree & Child(const size_t i) const
Return a particular child of this node.
This is not an actual space tree but instead an example tree that exists to show and document all the...
const MetricType & Metric() const
Get the instantiated metric for this node.
ExampleTree & Child(const size_t i)
Modify a particular child of this node.
const StatisticType & Stat() const
Get the statistic for this node.
double ParentDistance() const
Get the distance from the center of this node to the center of the parent node.
StatisticType & Stat()
Modify the statistic for this node.