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
5
6namespace 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
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}
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition Strategy.hpp:185
std::shared_ptr< Grouping > Ptr
Definition Strategy.hpp:95
Label-based grouping: create partitions from sorted class labels.
Definition ByLabel.hpp:17
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
std::set< types::Mode > supported_modes() const override
Training modes this strategy supports.
Definition ByLabel.hpp:23
std::string display_name() const override
Human-readable name for display in summaries.
Definition ByLabel.hpp:22
static Grouping::Ptr from_json(nlohmann::json const &j)
stats::GroupPartition compute_init(types::OutcomeVector const &y) const override
Create a GroupPartition from sorted integer-valued labels.
void compute(NodeContext &ctx, stats::RNG &rng) const override
Subclass implementation of per-node splitting.
Abstract strategy for managing group partitions.
Definition Grouping.hpp:31
Definition ByCutpoint.hpp:6
Statistical infrastructure for training and evaluation.
Definition ConfusionMatrix.hpp:11
Core numeric type aliases for the ppforest2 library.
Definition Types.hpp:22
@ Classification
Definition Types.hpp:58
Mutable context accumulating intermediate results during node training.
Definition NodeContext.hpp:20