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

Abstract strategy for computing the split threshold. More...

#include <SRStrategy.hpp>

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

Abstract strategy for computing the split threshold.

Given the data for two groups and a projection vector, determines the threshold value that separates the groups in the projected space. Concrete subclasses implement different splitting rules (e.g. mean of group means, median-based rules).

Implementations must also provide to_json() for serialization.

Member Function Documentation

◆ operator()()

types::Feature ppforest2::sr::SRStrategy::operator() ( types::FeatureMatrix const & group_1,
types::FeatureMatrix const & group_2,
pp::Projector const & projector ) const
inline

Convenience operator: equivalent to threshold().

◆ threshold()

virtual types::Feature ppforest2::sr::SRStrategy::threshold ( types::FeatureMatrix const & group_1,
types::FeatureMatrix const & group_2,
pp::Projector const & projector ) const
pure virtual

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.

Implemented in ppforest2::sr::SRMeanOfMeansStrategy.


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