|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Visitor that routes observations through the tree and collects per-node projection data for histogram rendering. More...
#include <Visualization.hpp>
Public Member Functions | |
| NodeDataVisitor (types::FeatureMatrix const &x, types::OutcomeVector const &y) | |
| void | visit (TreeBranch const &node) override |
| void | visit (TreeLeaf const &node) override |
Public Member Functions inherited from ppforest2::TreeNode::Visitor | |
| virtual | ~Visitor ()=default |
Public Attributes | |
| int | depth |
| Current depth in the traversal. | |
| std::vector< int > | indices |
| Indices of observations reaching the current node. | |
| std::vector< NodeData > | nodes |
| Collected node data (pre-order). | |
| types::FeatureMatrix const & | x |
| Full observation matrix (n × p). | |
| types::OutcomeVector const & | y |
| Full response vector (n). | |
Visitor that routes observations through the tree and collects per-node projection data for histogram rendering.
Usage:
At each split node the visitor projects all reaching observations onto the node's projector, records the projected values and group labels, partitions observation indices by the cutpoint, and recurses into the lower and upper children. Nodes are accumulated in pre-order (parent before children, left before right).
The observation routing respects the tree structure exactly: an observation reaching a split goes to the lower child if its projected value < cutpoint, otherwise to the upper child.
| ppforest2::viz::NodeDataVisitor::NodeDataVisitor | ( | types::FeatureMatrix const & | x, |
| types::OutcomeVector const & | y ) |
|
overridevirtual |
Reimplemented from ppforest2::TreeNode::Visitor.
|
overridevirtual |
Reimplemented from ppforest2::TreeNode::Visitor.
| int ppforest2::viz::NodeDataVisitor::depth |
Current depth in the traversal.
| std::vector<int> ppforest2::viz::NodeDataVisitor::indices |
Indices of observations reaching the current node.
| std::vector<NodeData> ppforest2::viz::NodeDataVisitor::nodes |
Collected node data (pre-order).
| types::FeatureMatrix const& ppforest2::viz::NodeDataVisitor::x |
Full observation matrix (n × p).
| types::OutcomeVector const& ppforest2::viz::NodeDataVisitor::y |
Full response vector (n).