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

Penalized Discriminant Analysis projection pursuit strategy. More...

#include <PPPDAStrategy.hpp>

Public Member Functions

 PPPDAStrategy (float lambda)
 
std::string display_name () const override
 Human-readable name for display in summaries.
 
types::Feature index (types::FeatureMatrix const &x, stats::GroupPartition const &group_spec, Projector const &projector) const override
 Evaluate the projection pursuit index for a given projector.
 
PPResult optimize (types::FeatureMatrix const &x, stats::GroupPartition const &group_spec) const override
 Find the optimal projection for the data.
 
void to_json (nlohmann::json &j) const override
 Serialize this strategy's configuration to JSON.
 
- Public Member Functions inherited from ppforest2::pp::PPStrategy
Projector operator() (types::FeatureMatrix const &x, stats::GroupPartition const &group_spec) const
 Convenience operator: optimize and return the projector only.
 
- Public Member Functions inherited from Strategy< PPStrategy >
virtual ~Strategy ()=default
 

Static Public Member Functions

static PPStrategy::Ptr from_json (nlohmann::json const &j)
 
- Static Public Member Functions inherited from Strategy< PPStrategy >
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< PPStrategy >
using Factory
 Factory function type for deserializing a strategy from JSON.
 
using Ptr
 

Detailed Description

Penalized Discriminant Analysis projection pursuit strategy.

Optimizes a linear discriminant projection using a penalized between-group / within-group variance ratio. The lambda parameter controls the penalty strength in the LDA index.

Constructor & Destructor Documentation

◆ PPPDAStrategy()

ppforest2::pp::PPPDAStrategy::PPPDAStrategy ( float lambda)
explicit

Member Function Documentation

◆ display_name()

std::string ppforest2::pp::PPPDAStrategy::display_name ( ) const
inlineoverridevirtual

Human-readable name for display in summaries.

Implements Strategy< PPStrategy >.

◆ from_json()

static PPStrategy::Ptr ppforest2::pp::PPPDAStrategy::from_json ( nlohmann::json const & j)
static

◆ index()

types::Feature ppforest2::pp::PPPDAStrategy::index ( types::FeatureMatrix const & x,
stats::GroupPartition const & group_spec,
Projector const & projector ) const
overridevirtual

Evaluate the projection pursuit index for a given projector.

Parameters
xFeature matrix (n × p).
group_specGroup partition.
projectorProjection vector (p).
Returns
Index value (higher is better separation).

Implements ppforest2::pp::PPStrategy.

◆ optimize()

PPResult ppforest2::pp::PPPDAStrategy::optimize ( types::FeatureMatrix const & x,
stats::GroupPartition const & group_spec ) const
overridevirtual

Find the optimal projection for the data.

Parameters
xFeature matrix (n × p).
group_specGroup partition.
Returns
Optimized projector and its index value.

Implements ppforest2::pp::PPStrategy.

◆ to_json()

void ppforest2::pp::PPPDAStrategy::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< PPStrategy >.


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