|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Internal split node in a projection pursuit tree. More...
#include <TreeBranch.hpp>
Public Types | |
| using | Ptr = std::unique_ptr<TreeBranch> |
Public Types inherited from ppforest2::TreeNode | |
| using | Ptr = std::unique_ptr<TreeNode> |
Public Member Functions | |
| TreeBranch (pp::Projector projector, types::Feature cutpoint, TreeNode::Ptr lower, TreeNode::Ptr upper, std::set< types::GroupId > groups={}, types::Feature pp_index_value=0) | |
| void | accept (TreeNode::Visitor &visitor) const override |
| Accept a tree node visitor (double dispatch). | |
| 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). | |
| int | group_count () const override |
| Number of distinct groups reachable from this node. | |
| std::set< types::GroupId > | node_groups () const override |
| Sorted set of group labels reachable from this node. | |
| types::Outcome | predict (types::FeatureVector const &x) const override |
| Route an observation through this split. | |
| types::Outcome | response () const override |
| Returns the response of the lower child. | |
Public Member Functions inherited from ppforest2::TreeNode | |
| virtual | ~TreeNode ()=default |
| bool | operator!= (TreeNode const &other) const |
| bool | operator== (TreeNode const &other) const |
Static Public Member Functions | |
| 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. | |
Public Attributes | |
| types::Feature | cutpoint |
| Split cutpoint on the projected value. | |
| std::set< types::GroupId > | groups |
| Set of group labels reachable from this node. | |
| TreeNode::Ptr | lower |
| Child node for observations with projected value < cutpoint. | |
| types::Feature | pp_index_value = 0 |
| Projection pursuit index value achieved at this split. | |
| pp::Projector | projector |
| Projection vector (p). Defines the linear combination of features. | |
| TreeNode::Ptr | upper |
| Child node for observations with projected value ≥ cutpoint. | |
Public Attributes inherited from ppforest2::TreeNode | |
| bool | degenerate = false |
| Whether this node (or any descendant) had a degenerate split. | |
Internal split node in a projection pursuit tree.
Projects an observation onto projector and compares the result against cutpoint. If the projected value is below the cutpoint the observation goes to the lower child; otherwise to upper.
| using ppforest2::TreeBranch::Ptr = std::unique_ptr<TreeBranch> |
| ppforest2::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 ) |
|
overridevirtual |
Accept a tree node visitor (double dispatch).
Implements ppforest2::TreeNode.
|
overridevirtual |
Deep copy of this node and its subtree.
Implements ppforest2::TreeNode.
|
overridevirtual |
Structural equality comparison (value-based).
Implements ppforest2::TreeNode.
|
inlineoverridevirtual |
Number of distinct groups reachable from this node.
Implements ppforest2::TreeNode.
|
static |
Factory method that returns a unique_ptr to a new TreeBranch.
|
inlineoverridevirtual |
Sorted set of group labels reachable from this node.
Implements ppforest2::TreeNode.
|
overridevirtual |
Route an observation through this split.
Projects x onto the projector, compares against the cutpoint, and delegates to the appropriate child node.
| x | Feature vector (p). |
Implements ppforest2::TreeNode.
|
overridevirtual |
Returns the response of the lower child.
Implements ppforest2::TreeNode.
| types::Feature ppforest2::TreeBranch::cutpoint |
Split cutpoint on the projected value.
| std::set<types::GroupId> ppforest2::TreeBranch::groups |
Set of group labels reachable from this node.
| TreeNode::Ptr ppforest2::TreeBranch::lower |
Child node for observations with projected value < cutpoint.
| types::Feature ppforest2::TreeBranch::pp_index_value = 0 |
Projection pursuit index value achieved at this split.
| pp::Projector ppforest2::TreeBranch::projector |
Projection vector (p). Defines the linear combination of features.
| TreeNode::Ptr ppforest2::TreeBranch::upper |
Child node for observations with projected value ≥ cutpoint.