ppforest2
v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
MeanResponse.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
models/strategies/leaf/LeafStrategy.hpp
"
4
#include "
models/strategies/Strategy.hpp
"
5
6
namespace
ppforest2::leaf
{
16
class
MeanResponse
:
public
LeafStrategy
{
17
public
:
18
static
LeafStrategy::Ptr
from_json
(nlohmann::json
const
& j);
19
20
nlohmann::json
to_json
()
const override
;
21
std::string
display_name
()
const override
{
return
"Mean response"
; }
22
std::set<types::Mode>
supported_modes
()
const override
{
return
{
types::Mode::Regression
}; }
23
24
PPFOREST2_REGISTER_STRATEGY
(
LeafStrategy
,
"mean_response"
)
25
26
protected:
30
TreeNode
::
Ptr
compute
(
NodeContext
const& ctx,
stats
::RNG& rng) const override;
31
};
32
}
LeafStrategy.hpp
Strategy.hpp
PPFOREST2_REGISTER_STRATEGY
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition
Strategy.hpp:185
Strategy< LeafStrategy >::Ptr
std::shared_ptr< LeafStrategy > Ptr
Definition
Strategy.hpp:95
ppforest2::TreeNode
Abstract base class for nodes in a projection pursuit tree.
Definition
TreeNode.hpp:19
ppforest2::leaf::LeafStrategy
Abstract strategy for creating leaf nodes.
Definition
LeafStrategy.hpp:26
ppforest2::leaf::MeanResponse
Leaf creation by mean response value.
Definition
MeanResponse.hpp:16
ppforest2::leaf::MeanResponse::compute
TreeNode::Ptr compute(NodeContext const &ctx, stats::RNG &rng) const override
Create a mean-response leaf from the node's observations.
ppforest2::leaf::MeanResponse::display_name
std::string display_name() const override
Human-readable name for display in summaries.
Definition
MeanResponse.hpp:21
ppforest2::leaf::MeanResponse::from_json
static LeafStrategy::Ptr from_json(nlohmann::json const &j)
ppforest2::leaf::MeanResponse::to_json
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
ppforest2::leaf::MeanResponse::supported_modes
std::set< types::Mode > supported_modes() const override
Training modes this strategy supports.
Definition
MeanResponse.hpp:22
ppforest2::leaf
Leaf creation strategies.
Definition
LeafStrategy.hpp:20
ppforest2::stats
Statistical infrastructure for training and evaluation.
Definition
ConfusionMatrix.hpp:11
ppforest2::types::Mode::Regression
@ Regression
Definition
Types.hpp:58
ppforest2::NodeContext
Mutable context accumulating intermediate results during node training.
Definition
NodeContext.hpp:20
core
src
models
strategies
leaf
MeanResponse.hpp
Generated by
1.13.2