ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
ppforest2::sr::SRMeanOfMeansStrategy Struct Reference

Split threshold as the mean of two group means. More...

#include <SRMeanOfMeansStrategy.hpp>

Public Member Functions

std::string display_name () const override
 Human-readable name for display in summaries.
 
types::Feature threshold (types::FeatureMatrix const &group_1, types::FeatureMatrix const &group_2, pp::Projector const &projector) const override
 Compute the split threshold for two groups.
 
void to_json (nlohmann::json &j) const override
 Serialize this strategy's configuration to JSON.
 
- Public Member Functions inherited from ppforest2::sr::SRStrategy
types::Feature operator() (types::FeatureMatrix const &group_1, types::FeatureMatrix const &group_2, pp::Projector const &projector) const
 Convenience operator: equivalent to threshold().
 
- Public Member Functions inherited from Strategy< SRStrategy >
virtual ~Strategy ()=default
 

Static Public Member Functions

static SRStrategy::Ptr from_json (nlohmann::json const &j)
 
- Static Public Member Functions inherited from Strategy< SRStrategy >
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.
 

Additional Inherited Members

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

Detailed Description

Split threshold as the mean of two group means.

Computes the midpoint between the projected means of the two groups: (mean(group_1 * A) + mean(group_2 * A)) / 2. This is the default rule used by PPforest.

Member Function Documentation

◆ display_name()

std::string ppforest2::sr::SRMeanOfMeansStrategy::display_name ( ) const
inlineoverridevirtual

Human-readable name for display in summaries.

Implements Strategy< SRStrategy >.

◆ from_json()

static SRStrategy::Ptr ppforest2::sr::SRMeanOfMeansStrategy::from_json ( nlohmann::json const & j)
static

◆ threshold()

types::Feature ppforest2::sr::SRMeanOfMeansStrategy::threshold ( types::FeatureMatrix const & group_1,
types::FeatureMatrix const & group_2,
pp::Projector const & projector ) const
overridevirtual

Compute the split threshold for two groups.

Parameters
group_1Feature matrix for the first group (n1 × p).
group_2Feature matrix for the second group (n2 × p).
projectorProjection vector (p).
Returns
Scalar threshold in the projected space.

Implements ppforest2::sr::SRStrategy.

◆ to_json()

void ppforest2::sr::SRMeanOfMeansStrategy::to_json ( nlohmann::json & j) const
overridevirtual

Serialize this strategy's configuration to JSON.

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

Parameters
jJSON object to populate.

Implements Strategy< SRStrategy >.


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