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
3
#include "
models/strategies/stop/StopRule.hpp
"
4
#include "
models/strategies/Strategy.hpp
"
5
6
#include <vector>
7
8
namespace
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
37
PPFOREST2_REGISTER_STRATEGY
(
StopRule
,
"any"
)
38
39
protected:
40
bool
compute
(
NodeContext
const& ctx,
stats
::RNG& rng) const override;
41
};
42
}
StopRule.hpp
Strategy.hpp
PPFOREST2_REGISTER_STRATEGY
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition
Strategy.hpp:185
Strategy< StopRule >::Ptr
std::shared_ptr< StopRule > Ptr
Definition
Strategy.hpp:95
ppforest2::stop::CompositeStop::rules
std::vector< StopRule::Ptr > rules
Definition
CompositeStop.hpp:19
ppforest2::stop::CompositeStop::CompositeStop
CompositeStop(std::vector< StopRule::Ptr > rules)
ppforest2::stop::CompositeStop::supported_modes
std::set< types::Mode > supported_modes() const override
Supported modes = intersection of child rules' supported modes.
ppforest2::stop::CompositeStop::compute
bool compute(NodeContext const &ctx, stats::RNG &rng) const override
Subclass implementation of the stop predicate.
ppforest2::stop::CompositeStop::from_json
static StopRule::Ptr from_json(nlohmann::json const &j)
ppforest2::stop::CompositeStop::to_json
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
ppforest2::stop::CompositeStop::display_name
std::string display_name() const override
Human-readable name for display in summaries.
ppforest2::stop::StopRule
Abstract strategy for tree stopping rules.
Definition
StopRule.hpp:26
ppforest2::stats
Statistical infrastructure for training and evaluation.
Definition
ConfusionMatrix.hpp:11
ppforest2::stop
Definition
CompositeStop.hpp:8
ppforest2::NodeContext
Mutable context accumulating intermediate results during node training.
Definition
NodeContext.hpp:20
core
src
models
strategies
stop
CompositeStop.hpp
Generated by
1.13.2