|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Cutpoint-based grouping for regression trees. More...
#include <ByCutpoint.hpp>
Public Member Functions | |
| std::string | display_name () const override |
| Human-readable name for display in summaries. | |
| std::set< types::Mode > | supported_modes () const override |
| Training modes this strategy supports. | |
| nlohmann::json | to_json () const override |
| Serialize this strategy's configuration to JSON. | |
Public Member Functions inherited from ppforest2::grouping::Grouping | |
| stats::GroupPartition | init (types::GroupIdVector const &y) const |
Convenience overload for callers with a GroupIdVector. | |
| stats::GroupPartition | init (types::OutcomeVector const &y) const |
| Create the initial GroupPartition from the training response. | |
| void | split (NodeContext &ctx, stats::RNG &rng) const |
| Split observations into two child partitions; writes ctx.lower_y_part / upper_y_part. | |
Public Member Functions inherited from Strategy< Grouping > | |
| virtual | ~Strategy ()=default |
Static Public Member Functions | |
| static Grouping::Ptr | from_json (nlohmann::json const &j) |
Static Public Member Functions inherited from Strategy< Grouping > | |
| static Ptr | from_json (nlohmann::json const &j) |
| Construct a strategy from its JSON representation. | |
| static bool | register_strategy (std::string const &name, Factory factory) |
| Register a concrete strategy for JSON deserialization. | |
Protected Member Functions | |
| void | compute (NodeContext &ctx, stats::RNG &rng) const override |
| Split observations by cutpoint and re-cluster each child. | |
| stats::GroupPartition | compute_init (types::OutcomeVector const &y) const override |
| Median-split the sorted continuous response into 2 groups. | |
Additional Inherited Members | |
Public Types inherited from Strategy< Grouping > | |
| using | Factory |
| Factory function type for deserializing a strategy from JSON. | |
| using | Ptr |
Cutpoint-based grouping for regression trees.
At each node, observations are split by the cutpoint in projected space, then each child's observations are sorted by continuous_y and median-split into 2 artificial groups for the next PDA projection.
Requires the non-const ctx.x and ctx.y_vec on NodeContext for in-place reordering of data within each node's range.
|
overrideprotectedvirtual |
Split observations by cutpoint and re-cluster each child.
Requires the non-const ctx.x and ctx.y_vec on the context.
Implements ppforest2::grouping::Grouping.
|
overrideprotectedvirtual |
Median-split the sorted continuous response into 2 groups.
The caller must pre-sort y ascending. For n >= 2 the result is GroupPartition(0, n - 1).bisect(n / 2); for n == 1 a single-group partition covering [0, 0] is returned.
Implements ppforest2::grouping::Grouping.
|
inlineoverridevirtual |
Human-readable name for display in summaries.
Implements Strategy< Grouping >.
|
static |
|
inlineoverridevirtual |
Training modes this strategy supports.
Every concrete strategy MUST explicitly declare which modes it supports — there is no default. This forces implementers to think about mode compatibility rather than silently inheriting both modes and triggering runtime surprises.
Used by TrainingSpec to validate that every selected strategy is compatible with the configured training mode. Fails fast at build time instead of silently misbehaving at train time.
Implements Strategy< Grouping >.
|
overridevirtual |
Serialize this strategy's configuration to JSON.
Must include a "name" field identifying the strategy type, plus any strategy-specific parameters.
Implements Strategy< Grouping >.