ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
MaxDepth.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace ppforest2::stop {
16 class MaxDepth : public StopRule {
17 public:
19
20 explicit MaxDepth(int max_depth);
21
22 static StopRule::Ptr from_json(nlohmann::json const& j);
23
24 nlohmann::json to_json() const override;
25 std::string display_name() const override;
26 std::set<types::Mode> supported_modes() const override {
28 }
29
31 PPFOREST2_REGISTER_PRIMARY_PARAM("max_depth", "max_depth")
32
33 protected:
34 bool compute(NodeContext const& ctx, stats::RNG& rng) const override;
35 };
36}
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition Strategy.hpp:185
#define PPFOREST2_REGISTER_PRIMARY_PARAM(strategy_name, param_name)
Declare the strategy's CLI positional-shorthand parameter.
Definition Strategy.hpp:228
std::shared_ptr< StopRule > Ptr
Definition Strategy.hpp:95
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
int max_depth
Definition MaxDepth.hpp:18
bool compute(NodeContext const &ctx, stats::RNG &rng) const override
Subclass implementation of the stop predicate.
std::string display_name() const override
Human-readable name for display in summaries.
static StopRule::Ptr from_json(nlohmann::json const &j)
std::set< types::Mode > supported_modes() const override
Training modes this strategy supports.
Definition MaxDepth.hpp:26
Abstract strategy for tree stopping rules.
Definition StopRule.hpp:26
Statistical infrastructure for training and evaluation.
Definition ConfusionMatrix.hpp:11
Definition CompositeStop.hpp:8
@ Classification
Definition Types.hpp:58
@ Regression
Definition Types.hpp:58
Mutable context accumulating intermediate results during node training.
Definition NodeContext.hpp:20