ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
StopRule.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "stats/Stats.hpp"
5
6#include <vector>
7
15namespace ppforest2 {
16 struct NodeContext;
17}
18
19namespace ppforest2::stop {
26 class StopRule : public Strategy<StopRule> {
27 public:
37 bool should_stop(NodeContext const& ctx, stats::RNG& rng) const;
38
39 protected:
41 virtual bool compute(NodeContext const& ctx, stats::RNG& rng) const = 0;
42 };
43
46
49
52
55
57 StopRule::Ptr any(std::vector<StopRule::Ptr> rules);
58}
CRTP base class providing self-registration for strategy types.
Definition Strategy.hpp:93
std::shared_ptr< StopRule > Ptr
Definition Strategy.hpp:95
Abstract strategy for tree stopping rules.
Definition StopRule.hpp:26
virtual bool compute(NodeContext const &ctx, stats::RNG &rng) const =0
Subclass implementation of the stop predicate.
bool should_stop(NodeContext const &ctx, stats::RNG &rng) const
Determine whether to stop growing at this node.
pcg32 RNG
Definition Stats.hpp:24
Definition CompositeStop.hpp:8
StopRule::Ptr min_variance(types::Feature threshold)
Factory function for minimum-variance stop rule.
StopRule::Ptr any(std::vector< StopRule::Ptr > rules)
Factory function for composite stop rule (logical OR).
StopRule::Ptr max_depth(int n)
Factory function for max-depth stop rule.
StopRule::Ptr min_size(int n)
Factory function for minimum-size stop rule.
StopRule::Ptr pure_node()
Factory function for pure-node stop rule.
float Feature
Scalar type for feature values.
Definition Types.hpp:24
Binarization strategies for multiclass-to-binary reduction.
Definition Benchmark.hpp:25
Mutable context accumulating intermediate results during node training.
Definition NodeContext.hpp:20