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

Abstract strategy for projection pursuit optimization. More...

#include <PPStrategy.hpp>

Public Member Functions

virtual types::Feature index (types::FeatureMatrix const &x, stats::GroupPartition const &group_spec, Projector const &projector) const =0
 Evaluate the projection pursuit index for a given projector.
 
Projector operator() (types::FeatureMatrix const &x, stats::GroupPartition const &group_spec) const
 Convenience operator: optimize and return the projector only.
 
virtual PPResult optimize (types::FeatureMatrix const &x, stats::GroupPartition const &group_spec) const =0
 Find the optimal projection for the data.
 
- Public Member Functions inherited from Strategy< PPStrategy >
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< PPStrategy >
using Factory
 Factory function type for deserializing a strategy from JSON.
 
using Ptr
 
- 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.
 

Detailed Description

Abstract strategy for projection pursuit optimization.

Defines how to evaluate a projection (via an index function) and how to find the optimal projection for a given dataset and group partition.

Implementations must also provide to_json() for serialization.

Member Function Documentation

◆ index()

virtual types::Feature ppforest2::pp::PPStrategy::index ( types::FeatureMatrix const & x,
stats::GroupPartition const & group_spec,
Projector const & projector ) const
pure virtual

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).

Implemented in ppforest2::pp::PPPDAStrategy.

◆ operator()()

Projector ppforest2::pp::PPStrategy::operator() ( types::FeatureMatrix const & x,
stats::GroupPartition const & group_spec ) const
inline

Convenience operator: optimize and return the projector only.

◆ optimize()

virtual PPResult ppforest2::pp::PPStrategy::optimize ( types::FeatureMatrix const & x,
stats::GroupPartition const & group_spec ) const
pure virtual

Find the optimal projection for the data.

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

Implemented in ppforest2::pp::PPPDAStrategy.


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