ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
CompositeStop.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <vector>
7
8namespace ppforest2::stop {
17 class CompositeStop : public StopRule {
18 public:
19 std::vector<StopRule::Ptr> rules;
20
21 explicit CompositeStop(std::vector<StopRule::Ptr> rules);
22
23 static StopRule::Ptr from_json(nlohmann::json const& j);
24
25 nlohmann::json to_json() const override;
26 std::string display_name() const override;
27
35 std::set<types::Mode> supported_modes() const override;
36
38
39 protected:
40 bool compute(NodeContext const& ctx, stats::RNG& rng) const override;
41 };
42}
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition Strategy.hpp:185
std::shared_ptr< StopRule > Ptr
Definition Strategy.hpp:95
std::vector< StopRule::Ptr > rules
Definition CompositeStop.hpp:19
CompositeStop(std::vector< StopRule::Ptr > rules)
std::set< types::Mode > supported_modes() const override
Supported modes = intersection of child rules' supported modes.
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)
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
std::string display_name() const override
Human-readable name for display in summaries.
Abstract strategy for tree stopping rules.
Definition StopRule.hpp:26
Statistical infrastructure for training and evaluation.
Definition ConfusionMatrix.hpp:11
Definition CompositeStop.hpp:8
Mutable context accumulating intermediate results during node training.
Definition NodeContext.hpp:20