ppforest2
v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
ByLabel.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
models/strategies/grouping/Grouping.hpp
"
4
#include "
models/strategies/Strategy.hpp
"
5
6
namespace
ppforest2::grouping
{
17
class
ByLabel
:
public
Grouping
{
18
public
:
19
static
Grouping::Ptr
from_json
(nlohmann::json
const
& j);
20
21
nlohmann::json
to_json
()
const override
;
22
std::string
display_name
()
const override
{
return
"By label"
; }
23
std::set<types::Mode>
supported_modes
()
const override
{
return
{
types::Mode::Classification
}; }
24
25
PPFOREST2_REGISTER_STRATEGY
(
Grouping
,
"by_label"
)
26
27
protected:
33
stats
::GroupPartition
compute_init
(
types
::OutcomeVector const& y) const override;
34
40
void
compute
(
NodeContext
& ctx,
stats
::RNG& rng) const override;
41
};
42
}
Grouping.hpp
Strategy.hpp
PPFOREST2_REGISTER_STRATEGY
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition
Strategy.hpp:185
Strategy< Grouping >::Ptr
std::shared_ptr< Grouping > Ptr
Definition
Strategy.hpp:95
ppforest2::grouping::ByLabel
Label-based grouping: create partitions from sorted class labels.
Definition
ByLabel.hpp:17
ppforest2::grouping::ByLabel::to_json
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
ppforest2::grouping::ByLabel::supported_modes
std::set< types::Mode > supported_modes() const override
Training modes this strategy supports.
Definition
ByLabel.hpp:23
ppforest2::grouping::ByLabel::display_name
std::string display_name() const override
Human-readable name for display in summaries.
Definition
ByLabel.hpp:22
ppforest2::grouping::ByLabel::from_json
static Grouping::Ptr from_json(nlohmann::json const &j)
ppforest2::grouping::ByLabel::compute_init
stats::GroupPartition compute_init(types::OutcomeVector const &y) const override
Create a GroupPartition from sorted integer-valued labels.
ppforest2::grouping::ByLabel::compute
void compute(NodeContext &ctx, stats::RNG &rng) const override
Subclass implementation of per-node splitting.
ppforest2::grouping::Grouping
Abstract strategy for managing group partitions.
Definition
Grouping.hpp:31
ppforest2::grouping
Definition
ByCutpoint.hpp:6
ppforest2::stats
Statistical infrastructure for training and evaluation.
Definition
ConfusionMatrix.hpp:11
ppforest2::types
Core numeric type aliases for the ppforest2 library.
Definition
Types.hpp:22
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
grouping
ByLabel.hpp
Generated by
1.13.2