|
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::ResponseVector const &y) | |
| void | visit (TreeCondition const &node) override |
| void | visit (TreeResponse const &node) override |
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::ResponseVector 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 threshold, 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 < threshold, otherwise to the upper child.
| ppforest2::viz::NodeDataVisitor::NodeDataVisitor | ( | types::FeatureMatrix const & | x, |
| types::ResponseVector const & | y ) |
|
overridevirtual |
Implements ppforest2::TreeNode::Visitor.
|
overridevirtual |
Implements 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::ResponseVector const& ppforest2::viz::NodeDataVisitor::y |
Full response vector (n).