ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
PureNode.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace ppforest2::stop {
13 class PureNode : public StopRule {
14 public:
15 static StopRule::Ptr from_json(nlohmann::json const& j);
16
17 nlohmann::json to_json() const override;
18 std::string display_name() const override { return "Pure node"; }
19 std::set<types::Mode> supported_modes() const override { return {types::Mode::Classification}; }
20
22
23 protected:
24 bool compute(NodeContext const& ctx, stats::RNG& rng) const override;
25 };
26}
#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
Stop when the node contains only one group (pure node).
Definition PureNode.hpp:13
std::set< types::Mode > supported_modes() const override
Training modes this strategy supports.
Definition PureNode.hpp:19
std::string display_name() const override
Human-readable name for display in summaries.
Definition PureNode.hpp:18
bool compute(NodeContext const &ctx, stats::RNG &rng) const override
Subclass implementation of the stop predicate.
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
static StopRule::Ptr from_json(nlohmann::json const &j)
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
Mutable context accumulating intermediate results during node training.
Definition NodeContext.hpp:20