ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
MinSize.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace ppforest2::stop {
11 class MinSize : public StopRule {
12 public:
14
15 explicit MinSize(int min_size);
16
17 static StopRule::Ptr from_json(nlohmann::json const& j);
18
19 nlohmann::json to_json() const override;
20 std::string display_name() const override;
21 std::set<types::Mode> supported_modes() const override {
23 }
24
26 PPFOREST2_REGISTER_PRIMARY_PARAM("min_size", "min_size")
27
28 protected:
29 bool compute(NodeContext const& ctx, stats::RNG& rng) const override;
30 };
31}
#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
std::set< types::Mode > supported_modes() const override
Training modes this strategy supports.
Definition MinSize.hpp:21
bool compute(NodeContext const &ctx, stats::RNG &rng) const override
Subclass implementation of the stop predicate.
static StopRule::Ptr from_json(nlohmann::json const &j)
int min_size
Definition MinSize.hpp:13
std::string display_name() const override
Human-readable name for display in summaries.
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
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