21 using Ptr = std::unique_ptr<TreeNode>;
Internal split node in a projection pursuit tree.
Definition TreeBranch.hpp:15
Leaf node in a projection pursuit tree.
Definition TreeLeaf.hpp:12
Visitor interface for tree node dispatch.
Definition TreeNode.hpp:31
virtual void visit(TreeLeaf const &)
Definition TreeNode.hpp:36
virtual ~Visitor()=default
virtual void visit(TreeBranch const &)
Definition TreeNode.hpp:35
Abstract base class for nodes in a projection pursuit tree.
Definition TreeNode.hpp:19
bool operator!=(TreeNode const &other) const
virtual std::set< types::GroupId > node_groups() const =0
Sorted set of group labels reachable from this node.
bool degenerate
Whether this node (or any descendant) had a degenerate split.
Definition TreeNode.hpp:40
virtual void accept(Visitor &visitor) const =0
Accept a tree node visitor (double dispatch).
virtual types::Outcome predict(types::FeatureVector const &x) const =0
Predict the group label for a single observation.
virtual bool equals(TreeNode const &other) const =0
Structural equality comparison (value-based).
virtual types::Outcome response() const =0
The group label at this node (leaf value or majority group).
std::unique_ptr< TreeNode > Ptr
Definition TreeNode.hpp:21
virtual int group_count() const =0
Number of distinct groups reachable from this node.
virtual ~TreeNode()=default
bool operator==(TreeNode const &other) const
virtual Ptr clone() const =0
Deep copy of this node and its subtree.
Eigen::Matrix< Feature, Eigen::Dynamic, 1 > FeatureVector
Dynamic-size column vector of feature values.
Definition Types.hpp:36
Feature Outcome
Scalar type for predictions (float for both classification and regression).
Definition Types.hpp:30
Binarization strategies for multiclass-to-binary reduction.
Definition Benchmark.hpp:25
bool is_leaf(TreeNode const &node)
Whether node is a TreeLeaf.