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
3
#include "
models/strategies/Strategy.hpp
"
4
#include "
stats/Stats.hpp
"
5
6
#include <vector>
7
15
namespace
ppforest2
{
16
struct
NodeContext
;
17
}
18
19
namespace
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
45
StopRule::Ptr
pure_node
();
46
48
StopRule::Ptr
min_size
(
int
n);
49
51
StopRule::Ptr
min_variance
(
types::Feature
threshold);
52
54
StopRule::Ptr
max_depth
(
int
n);
55
57
StopRule::Ptr
any
(std::vector<StopRule::Ptr> rules);
58
}
Stats.hpp
Strategy.hpp
Strategy
CRTP base class providing self-registration for strategy types.
Definition
Strategy.hpp:93
Strategy< StopRule >::Ptr
std::shared_ptr< StopRule > Ptr
Definition
Strategy.hpp:95
ppforest2::stop::StopRule
Abstract strategy for tree stopping rules.
Definition
StopRule.hpp:26
ppforest2::stop::StopRule::compute
virtual bool compute(NodeContext const &ctx, stats::RNG &rng) const =0
Subclass implementation of the stop predicate.
ppforest2::stop::StopRule::should_stop
bool should_stop(NodeContext const &ctx, stats::RNG &rng) const
Determine whether to stop growing at this node.
ppforest2::stats::RNG
pcg32 RNG
Definition
Stats.hpp:24
ppforest2::stop
Definition
CompositeStop.hpp:8
ppforest2::stop::min_variance
StopRule::Ptr min_variance(types::Feature threshold)
Factory function for minimum-variance stop rule.
ppforest2::stop::any
StopRule::Ptr any(std::vector< StopRule::Ptr > rules)
Factory function for composite stop rule (logical OR).
ppforest2::stop::max_depth
StopRule::Ptr max_depth(int n)
Factory function for max-depth stop rule.
ppforest2::stop::min_size
StopRule::Ptr min_size(int n)
Factory function for minimum-size stop rule.
ppforest2::stop::pure_node
StopRule::Ptr pure_node()
Factory function for pure-node stop rule.
ppforest2::types::Feature
float Feature
Scalar type for feature values.
Definition
Types.hpp:24
ppforest2
Binarization strategies for multiclass-to-binary reduction.
Definition
Benchmark.hpp:25
ppforest2::NodeContext
Mutable context accumulating intermediate results during node training.
Definition
NodeContext.hpp:20
core
src
models
strategies
stop
StopRule.hpp
Generated by
1.13.2