|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Abstract base class for nodes in a projection pursuit tree. More...
#include <TreeNode.hpp>
Classes | |
| struct | Visitor |
| Visitor interface for tree node dispatch. More... | |
Public Types | |
| using | Ptr = std::unique_ptr<TreeNode> |
Public Member Functions | |
| virtual | ~TreeNode ()=default |
| virtual void | accept (Visitor &visitor) const =0 |
| Accept a tree node visitor (double dispatch). | |
| virtual Ptr | clone () const =0 |
| Deep copy of this node and its subtree. | |
| virtual bool | equals (TreeNode const &other) const =0 |
| Structural equality comparison (value-based). | |
| virtual int | group_count () const =0 |
| Number of distinct groups reachable from this node. | |
| virtual bool | is_leaf () const =0 |
| Whether this node is a leaf (TreeResponse). | |
| virtual std::set< types::Response > | node_groups () const =0 |
| Sorted set of group labels reachable from this node. | |
| bool | operator!= (TreeNode const &other) const |
| bool | operator== (TreeNode const &other) const |
| virtual types::Response | predict (types::FeatureVector const &data) const =0 |
| Predict the group label for a single observation. | |
| virtual types::Response | response () const =0 |
| The group label at this node (leaf value or majority group). | |
Public Attributes | |
| bool | degenerate = false |
| Whether this node (or any descendant) had a degenerate split. | |
Abstract base class for nodes in a projection pursuit tree.
A tree is a recursive structure of nodes: internal split nodes (TreeCondition) that project and threshold, and leaf nodes (TreeResponse) that hold a group label.
| using ppforest2::TreeNode::Ptr = std::unique_ptr<TreeNode> |
|
virtualdefault |
|
pure virtual |
Accept a tree node visitor (double dispatch).
Implemented in ppforest2::TreeCondition, and ppforest2::TreeResponse.
|
pure virtual |
Deep copy of this node and its subtree.
Implemented in ppforest2::TreeCondition, and ppforest2::TreeResponse.
|
pure virtual |
Structural equality comparison (value-based).
Implemented in ppforest2::TreeCondition, and ppforest2::TreeResponse.
|
pure virtual |
Number of distinct groups reachable from this node.
Implemented in ppforest2::TreeCondition, and ppforest2::TreeResponse.
|
pure virtual |
Whether this node is a leaf (TreeResponse).
Implemented in ppforest2::TreeCondition, and ppforest2::TreeResponse.
|
pure virtual |
Sorted set of group labels reachable from this node.
Implemented in ppforest2::TreeCondition, and ppforest2::TreeResponse.
| bool ppforest2::TreeNode::operator!= | ( | TreeNode const & | other | ) | const |
| bool ppforest2::TreeNode::operator== | ( | TreeNode const & | other | ) | const |
|
pure virtual |
Predict the group label for a single observation.
| data | Feature vector (p). |
Implemented in ppforest2::TreeCondition, and ppforest2::TreeResponse.
|
pure virtual |
The group label at this node (leaf value or majority group).
Implemented in ppforest2::TreeCondition, and ppforest2::TreeResponse.
| bool ppforest2::TreeNode::degenerate = false |
Whether this node (or any descendant) had a degenerate split.