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
3
#include "
models/strategies/stop/StopRule.hpp
"
4
#include "
models/strategies/Strategy.hpp
"
5
6
namespace
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
21
PPFOREST2_REGISTER_STRATEGY
(
StopRule
,
"pure_node"
)
22
23
protected:
24
bool
compute
(
NodeContext
const& ctx,
stats
::RNG& rng) const override;
25
};
26
}
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::PureNode
Stop when the node contains only one group (pure node).
Definition
PureNode.hpp:13
ppforest2::stop::PureNode::supported_modes
std::set< types::Mode > supported_modes() const override
Training modes this strategy supports.
Definition
PureNode.hpp:19
ppforest2::stop::PureNode::display_name
std::string display_name() const override
Human-readable name for display in summaries.
Definition
PureNode.hpp:18
ppforest2::stop::PureNode::compute
bool compute(NodeContext const &ctx, stats::RNG &rng) const override
Subclass implementation of the stop predicate.
ppforest2::stop::PureNode::to_json
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
ppforest2::stop::PureNode::from_json
static StopRule::Ptr from_json(nlohmann::json const &j)
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::types::Mode::Classification
@ Classification
Definition
Types.hpp:58
ppforest2::NodeContext
Mutable context accumulating intermediate results during node training.
Definition
NodeContext.hpp:20
core
src
models
strategies
stop
PureNode.hpp
Generated by
1.13.2