ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
ppforest2::leaf::LeafStrategy Class Referenceabstract

Abstract strategy for creating leaf nodes. More...

#include <LeafStrategy.hpp>

Public Member Functions

TreeNode::Ptr create_leaf (NodeContext const &ctx, stats::RNG &rng) const
 Create a leaf node for the given node context.
 
- Public Member Functions inherited from Strategy< LeafStrategy >
virtual ~Strategy ()=default
 
virtual std::string display_name () const=0
 Human-readable name for display in summaries.
 
virtual std::set< ppforest2::types::Modesupported_modes () const=0
 Training modes this strategy supports.
 
virtual nlohmann::json to_json () const=0
 Serialize this strategy's configuration to JSON.
 

Protected Member Functions

virtual TreeNode::Ptr compute (NodeContext const &ctx, stats::RNG &rng) const =0
 Subclass implementation of leaf construction.
 

Additional Inherited Members

- Public Types inherited from Strategy< LeafStrategy >
using Factory
 Factory function type for deserializing a strategy from JSON.
 
using Ptr
 
- Static Public Member Functions inherited from Strategy< LeafStrategy >
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 creating leaf nodes.

Returns a leaf node. Does not write to the context.

Member Function Documentation

◆ compute()

virtual TreeNode::Ptr ppforest2::leaf::LeafStrategy::compute ( NodeContext const & ctx,
stats::RNG & rng ) const
protectedpure virtual

Subclass implementation of leaf construction.

Implemented in ppforest2::leaf::MajorityVote, and ppforest2::leaf::MeanResponse.

◆ create_leaf()

TreeNode::Ptr ppforest2::leaf::LeafStrategy::create_leaf ( NodeContext const & ctx,
stats::RNG & rng ) const
inline

Create a leaf node for the given node context.

Public NVI entry point that delegates to the subclass-provided compute.


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