ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
Uniform.hpp
Go to the documentation of this file.
1#pragma once
2
5#include "utils/Types.hpp"
6
7namespace ppforest2::vars {
15 class Uniform : public VariableSelection {
16 public:
17 explicit Uniform(int n_vars);
18
19 protected:
20 void compute(NodeContext& ctx, stats::RNG& rng) const override;
21
22 public:
23 nlohmann::json to_json() const override;
24 std::string display_name() const override { return "Uniform random"; }
25
26 std::set<types::Mode> supported_modes() const override {
28 }
29
30 static VariableSelection::Ptr from_json(nlohmann::json const& j);
32 PPFOREST2_REGISTER_PRIMARY_PARAM("uniform", "count")
33
34 private:
36 int const n_vars;
37 };
38}
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition Strategy.hpp:185
#define PPFOREST2_REGISTER_PRIMARY_PARAM(strategy_name, param_name)
Declare the strategy's CLI positional-shorthand parameter.
Definition Strategy.hpp:228
std::shared_ptr< VariableSelection > Ptr
Definition Strategy.hpp:95
static VariableSelection::Ptr from_json(nlohmann::json const &j)
nlohmann::json to_json() const override
Serialize this strategy's configuration to JSON.
std::string display_name() const override
Human-readable name for display in summaries.
Definition Uniform.hpp:24
void compute(NodeContext &ctx, stats::RNG &rng) const override
Subclass implementation of variable selection.
std::set< types::Mode > supported_modes() const override
Training modes this strategy supports.
Definition Uniform.hpp:26
Abstract strategy for variable selection.
Definition VariableSelection.hpp:27
pcg32 RNG
Definition Stats.hpp:24
@ Classification
Definition Types.hpp:58
@ Regression
Definition Types.hpp:58
Definition All.hpp:6
Mutable context accumulating intermediate results during node training.
Definition NodeContext.hpp:20