|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Label-based grouping: create partitions from sorted class labels. More...
#include <ByLabel.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 |
| Subclass implementation of per-node splitting. | |
| stats::GroupPartition | compute_init (types::OutcomeVector const &y) const override |
| Create a GroupPartition from sorted integer-valued labels. | |
Additional Inherited Members | |
Public Types inherited from Strategy< Grouping > | |
| using | Factory |
| Factory function type for deserializing a strategy from JSON. | |
| using | Ptr |
Label-based grouping: create partitions from sorted class labels.
This is the default classification grouping strategy.
|
overrideprotectedvirtual |
Subclass implementation of per-node splitting.
Writes ctx.lower_y_part and ctx.upper_y_part.
Implements ppforest2::grouping::Grouping.
|
overrideprotectedvirtual |
Create a GroupPartition from sorted integer-valued labels.
Casts the float-typed y to GroupIdVector internally.
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 >.