ppforest2
v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
LargestGap.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
models/strategies/binarize/Binarization.hpp
"
4
#include "
models/strategies/Strategy.hpp
"
5
#include "
utils/Types.hpp
"
6
7
namespace
ppforest2::binarize
{
16
class
LargestGap
:
public
Binarization
{
17
public
:
18
static
Binarization::Ptr
from_json
(nlohmann::json
const
& j);
19
20
nlohmann::json
to_json
()
const override
;
21
std::string
display_name
()
const override
{
return
"Largest gap"
; }
22
std::set<types::Mode>
supported_modes
()
const override
{
return
{
types::Mode::Classification
}; }
23
24
PPFOREST2_REGISTER_STRATEGY
(
Binarization
,
"largest_gap"
)
25
26
protected:
27
void
compute
(
NodeContext
& ctx,
stats
::RNG& rng) const override;
28
};
29
}
Binarization.hpp
Strategy.hpp
PPFOREST2_REGISTER_STRATEGY
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition
Strategy.hpp:185
Types.hpp
Strategy< Binarization >::Ptr
std::shared_ptr< Binarization > Ptr
Definition
Strategy.hpp:95
ppforest2::binarize::Binarization
Abstract strategy for multiclass-to-binary reduction.
Definition
Binarization.hpp:24
ppforest2::binarize::LargestGap
Binarization by largest gap between sorted projected group means.
Definition
LargestGap.hpp:16
ppforest2::binarize::LargestGap::compute
void compute(NodeContext &ctx, stats::RNG &rng) const override
Subclass implementation of binarization.
ppforest2::binarize::LargestGap::from_json
static Binarization::Ptr from_json(nlohmann::json const &j)
ppforest2::binarize::LargestGap::display_name
std::string display_name() const override
Human-readable name for display in summaries.
Definition
LargestGap.hpp:21
ppforest2::binarize::LargestGap::supported_modes
std::set< types::Mode > supported_modes() const override
Training modes this strategy supports.
Definition
LargestGap.hpp:22
ppforest2::binarize::LargestGap::to_json
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
ppforest2::binarize
Definition
Binarization.hpp:18
ppforest2::stats
Statistical infrastructure for training and evaluation.
Definition
ConfusionMatrix.hpp:11
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
binarize
LargestGap.hpp
Generated by
1.13.2