ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
ppforest2::binarize::Disabled Class Reference

Placeholder binarizer for specs that never reach binarization. More...

#include <Disabled.hpp>

Public Member Functions

std::string display_name () const override
 Human-readable name for display in summaries.
 
std::set< types::Modesupported_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::binarize::Binarization
void regroup (NodeContext &ctx, stats::RNG &rng) const
 Reduce a multiclass partition to binary and store in context.
 
- Public Member Functions inherited from Strategy< Binarization >
virtual ~Strategy ()=default
 

Static Public Member Functions

static Binarization::Ptr from_json (nlohmann::json const &j)
 
- Static Public Member Functions inherited from Strategy< Binarization >
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
 Always raises an invariant — Disabled should never be reached at runtime. See class-level note.
 

Additional Inherited Members

- Public Types inherited from Strategy< Binarization >
using Factory
 Factory function type for deserializing a strategy from JSON.
 
using Ptr
 

Detailed Description

Placeholder binarizer for specs that never reach binarization.

Default for regression, where ByCutpoint grouping always produces a 2-group partition at each node — so the binary path in tree training never calls binarize. Disabled gives such specs a well-typed, mode-compatible binarizer without introducing a nullable binarize field.

Contract: regroup is never called in correct configurations. If it IS called (i.e. an upstream grouping strategy produced a >2-group partition while Disabled is configured), the call raises an invariant with a clear diagnostic rather than silently passing through. Catches the misconfiguration at the earliest point instead of letting it propagate to a downstream assertion.

Member Function Documentation

◆ compute()

void ppforest2::binarize::Disabled::compute ( NodeContext & ctx,
stats::RNG & rng ) const
overrideprotectedvirtual

Always raises an invariant — Disabled should never be reached at runtime. See class-level note.

Implements ppforest2::binarize::Binarization.

◆ display_name()

std::string ppforest2::binarize::Disabled::display_name ( ) const
inlineoverridevirtual

Human-readable name for display in summaries.

Implements Strategy< Binarization >.

◆ from_json()

static Binarization::Ptr ppforest2::binarize::Disabled::from_json ( nlohmann::json const & j)
static

◆ supported_modes()

std::set< types::Mode > ppforest2::binarize::Disabled::supported_modes ( ) const
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< Binarization >.

◆ to_json()

nlohmann::json ppforest2::binarize::Disabled::to_json ( ) const
overridevirtual

Serialize this strategy's configuration to JSON.

Must include a "name" field identifying the strategy type, plus any strategy-specific parameters.

Implements Strategy< Binarization >.


The documentation for this class was generated from the following file: