17 using Ptr = std::unique_ptr<TreeBranch>;
38 std::set<types::GroupId>
groups = {},
71 std::set<types::GroupId>
groups = {},
types::Outcome predict(types::FeatureVector const &x) const override
Route an observation through this split.
std::set< types::GroupId > node_groups() const override
Sorted set of group labels reachable from this node.
Definition TreeBranch.hpp:60
types::Outcome response() const override
Returns the response of the lower child.
std::unique_ptr< TreeBranch > Ptr
Definition TreeBranch.hpp:17
TreeNode::Ptr clone() const override
Deep copy of this node and its subtree.
bool equals(TreeNode const &other) const override
Structural equality comparison (value-based).
TreeNode::Ptr upper
Child node for observations with projected value ≥ cutpoint.
Definition TreeBranch.hpp:26
types::Feature cutpoint
Split cutpoint on the projected value.
Definition TreeBranch.hpp:22
void accept(TreeNode::Visitor &visitor) const override
Accept a tree node visitor (double dispatch).
static Ptr make(pp::Projector projector, types::Feature cutpoint, TreeNode::Ptr lower, TreeNode::Ptr upper, std::set< types::GroupId > groups={}, types::Feature pp_index_value=0)
Factory method that returns a unique_ptr to a new TreeBranch.
TreeBranch(pp::Projector projector, types::Feature cutpoint, TreeNode::Ptr lower, TreeNode::Ptr upper, std::set< types::GroupId > groups={}, types::Feature pp_index_value=0)
std::set< types::GroupId > groups
Set of group labels reachable from this node.
Definition TreeBranch.hpp:29
types::Feature pp_index_value
Projection pursuit index value achieved at this split.
Definition TreeBranch.hpp:31
pp::Projector projector
Projection vector (p). Defines the linear combination of features.
Definition TreeBranch.hpp:20
TreeNode::Ptr lower
Child node for observations with projected value < cutpoint.
Definition TreeBranch.hpp:24
int group_count() const override
Number of distinct groups reachable from this node.
Definition TreeBranch.hpp:58
Visitor interface for tree node dispatch.
Definition TreeNode.hpp:31
Abstract base class for nodes in a projection pursuit tree.
Definition TreeNode.hpp:19
std::unique_ptr< TreeNode > Ptr
Definition TreeNode.hpp:21
types::FeatureVector Projector
Column vector of projection coefficients (one per variable).
Definition Projector.hpp:6
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
float Feature
Scalar type for feature values.
Definition Types.hpp:24
Binarization strategies for multiclass-to-binary reduction.
Definition Benchmark.hpp:25