|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Stop when the response variance is below a threshold. More...
#include <MinVariance.hpp>
Public Member Functions | |
| MinVariance (types::Feature threshold) | |
| 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::stop::StopRule | |
| bool | should_stop (NodeContext const &ctx, stats::RNG &rng) const |
| Determine whether to stop growing at this node. | |
Public Member Functions inherited from Strategy< StopRule > | |
| virtual | ~Strategy ()=default |
Static Public Member Functions | |
| static StopRule::Ptr | from_json (nlohmann::json const &j) |
Static Public Member Functions inherited from Strategy< StopRule > | |
| 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. | |
Public Attributes | |
| types::Feature | threshold |
Protected Member Functions | |
| bool | compute (NodeContext const &ctx, stats::RNG &rng) const override |
| Subclass implementation of the stop predicate. | |
Additional Inherited Members | |
Public Types inherited from Strategy< StopRule > | |
| using | Factory |
| Factory function type for deserializing a strategy from JSON. | |
| using | Ptr |
Stop when the response variance is below a threshold.
Useful for regression trees. A node becomes a leaf when the variance of the continuous response among its observations falls below the specified threshold.
Requires NodeContext::continuous_y to be set.
|
explicit |
|
overrideprotectedvirtual |
Subclass implementation of the stop predicate.
Implements ppforest2::stop::StopRule.
|
overridevirtual |
Human-readable name for display in summaries.
Implements Strategy< StopRule >.
|
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< StopRule >.
|
overridevirtual |
Serialize this strategy's configuration to JSON.
Must include a "name" field identifying the strategy type, plus any strategy-specific parameters.
Implements Strategy< StopRule >.
| types::Feature ppforest2::stop::MinVariance::threshold |