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
5
6namespace 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
25
26 protected:
30 TreeNode::Ptr compute(NodeContext const& ctx, stats::RNG& rng) const override;
31 };
32}
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition Strategy.hpp:185
std::shared_ptr< LeafStrategy > Ptr
Definition Strategy.hpp:95
Abstract base class for nodes in a projection pursuit tree.
Definition TreeNode.hpp:19
Abstract strategy for creating leaf nodes.
Definition LeafStrategy.hpp:26
Leaf creation by mean response value.
Definition MeanResponse.hpp:16
TreeNode::Ptr compute(NodeContext const &ctx, stats::RNG &rng) const override
Create a mean-response leaf from the node's observations.
std::string display_name() const override
Human-readable name for display in summaries.
Definition MeanResponse.hpp:21
static LeafStrategy::Ptr from_json(nlohmann::json const &j)
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
std::set< types::Mode > supported_modes() const override
Training modes this strategy supports.
Definition MeanResponse.hpp:22
Leaf creation strategies.
Definition LeafStrategy.hpp:20
Statistical infrastructure for training and evaluation.
Definition ConfusionMatrix.hpp:11
@ Regression
Definition Types.hpp:58
Mutable context accumulating intermediate results during node training.
Definition NodeContext.hpp:20