|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Internal split node in a projection pursuit tree. More...
#include <TreeCondition.hpp>
Public Types | |
| using | Ptr = std::unique_ptr<TreeCondition> |
Public Types inherited from ppforest2::TreeNode | |
| using | Ptr = std::unique_ptr<TreeNode> |
Public Member Functions | |
| TreeCondition (pp::Projector projector, Threshold threshold, TreeNode::Ptr lower, TreeNode::Ptr upper, std::set< types::Response > 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. | |
| bool | is_leaf () const override |
| Whether this node is a leaf (TreeResponse). | |
| std::set< types::Response > | node_groups () const override |
| Sorted set of group labels reachable from this node. | |
| types::Response | predict (types::FeatureVector const &data) const override |
| Route an observation through this split. | |
| types::Response | 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, Threshold threshold, TreeNode::Ptr lower, TreeNode::Ptr upper, std::set< types::Response > groups={}, types::Feature pp_index_value=0) |
| Factory method that returns a unique_ptr to a new TreeCondition. | |
Public Attributes | |
| std::set< types::Response > | groups |
| Set of group labels reachable from this node. | |
| TreeNode::Ptr | lower |
| Child node for observations with projected value < threshold. | |
| 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. | |
| Threshold | threshold |
| Split threshold on the projected value. | |
| TreeNode::Ptr | upper |
| Child node for observations with projected value ≥ threshold. | |
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 threshold. If the projected value is below the threshold the observation goes to the lower child; otherwise to upper.
| using ppforest2::TreeCondition::Ptr = std::unique_ptr<TreeCondition> |
| ppforest2::TreeCondition::TreeCondition | ( | pp::Projector | projector, |
| Threshold | threshold, | ||
| TreeNode::Ptr | lower, | ||
| TreeNode::Ptr | upper, | ||
| std::set< types::Response > | 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.
|
inlineoverridevirtual |
Whether this node is a leaf (TreeResponse).
Implements ppforest2::TreeNode.
|
static |
Factory method that returns a unique_ptr to a new TreeCondition.
|
inlineoverridevirtual |
Sorted set of group labels reachable from this node.
Implements ppforest2::TreeNode.
|
overridevirtual |
Route an observation through this split.
Projects data onto the projector, compares against the threshold, and delegates to the appropriate child node.
| data | Feature vector (p). |
Implements ppforest2::TreeNode.
|
overridevirtual |
Returns the response of the lower child.
Implements ppforest2::TreeNode.
| std::set<types::Response> ppforest2::TreeCondition::groups |
Set of group labels reachable from this node.
| TreeNode::Ptr ppforest2::TreeCondition::lower |
Child node for observations with projected value < threshold.
| types::Feature ppforest2::TreeCondition::pp_index_value = 0 |
Projection pursuit index value achieved at this split.
| pp::Projector ppforest2::TreeCondition::projector |
Projection vector (p). Defines the linear combination of features.
| Threshold ppforest2::TreeCondition::threshold |
Split threshold on the projected value.
| TreeNode::Ptr ppforest2::TreeCondition::upper |
Child node for observations with projected value ≥ threshold.