|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
A convex decision region polygon in 2D with its predicted group. More...
#include <Visualization.hpp>
Public Attributes | |
| types::Response | predicted_group |
| 0-indexed group label from the leaf. | |
| std::vector< std::pair< types::Feature, types::Feature > > | vertices |
A convex decision region polygon in 2D with its predicted group.
Each leaf in the tree produces one region: the bounding box clipped by all ancestor half-space constraints (Sutherland–Hodgman algorithm). Vertices are ordered for polygon rendering (either CW or CCW, consistent with the initial bounding box winding).
The union of all leaf regions tiles the entire bounding box — every point in the bbox belongs to exactly one leaf's region. This guarantees that region polygons fully cover the plot area when the bounding box matches the visible coordinate range.
Produced by RegionVisitor; consumed by the R layer via build_region_df() and rendered with ggplot2::geom_polygon().
| types::Response ppforest2::viz::RegionPolygon::predicted_group |
0-indexed group label from the leaf.
| std::vector<std::pair<types::Feature, types::Feature> > ppforest2::viz::RegionPolygon::vertices |