ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
CLIOptions.hpp
Go to the documentation of this file.
1
8#pragma once
9
10#include "cli/ModelParams.hpp"
13#include "cli/ServeParams.hpp"
14#include "io/Output.hpp"
15
16#include <nlohmann/json.hpp>
17#include <string>
18
23namespace ppforest2::cli {
25 enum class Subcommand : uint8_t { none, train, predict, evaluate, benchmark, summarize, serve };
26
33 struct Params {
35
41
42 std::string data_path;
43 std::string save_path = "model.json";
44 std::string model_path;
45 std::string output_path;
46
47 bool quiet = false;
48 bool no_save = false;
49 bool no_metrics = false;
50 bool no_color = false;
51 bool no_proportions = false;
52
53 Params() = default;
54
56 explicit Params(nlohmann::json const& config);
57
65 void resolve();
66
69
79
85 void resolve_defaults(unsigned int total_vars);
86
88 nlohmann::json to_json() const;
89 };
90
94 void warn_unused_params(io::Output& out, Params const& params);
95
103 Params parse_args(int argc, char* argv[]);
104}
Benchmark-specific CLI parameters.
Evaluate-specific CLI parameters: simulation, convergence, and evaluation options.
Model training parameters shared by train and evaluate.
Quiet-aware output context for CLI subcommands.
Serve subcommand parameters.
Definition ServeHandlers.hpp:24
Command-line interface: argument parsing, subcommands, and benchmark/evaluation orchestration.
Definition Benchmark.hpp:25
Subcommand
Available CLI subcommands.
Definition CLIOptions.hpp:25
@ benchmark
Definition CLIOptions.hpp:25
@ summarize
Definition CLIOptions.hpp:25
@ none
Definition CLIOptions.hpp:25
@ predict
Definition CLIOptions.hpp:25
@ train
Definition CLIOptions.hpp:25
@ evaluate
Definition CLIOptions.hpp:25
void warn_unused_params(io::Output &out, Params const &params)
Warn the user about parameters that are ignored for single-tree training.
Params parse_args(int argc, char *argv[])
Parse command-line arguments into a Params struct.
pcg32 RNG
Definition Stats.hpp:24
Benchmark-specific options.
Definition BenchmarkParams.hpp:12
Evaluate and convergence options (shared by evaluate + benchmark).
Definition EvaluateParams.hpp:45
Model training parameters shared by train and evaluate.
Definition ModelParams.hpp:14
All CLI options and runtime parameters.
Definition CLIOptions.hpp:33
bool no_metrics
Definition CLIOptions.hpp:49
bool no_save
Definition CLIOptions.hpp:48
std::string data_path
Definition CLIOptions.hpp:42
void resolve_seed()
Generate a random seed if none was set.
bool no_proportions
Definition CLIOptions.hpp:51
std::string save_path
Definition CLIOptions.hpp:43
std::string model_path
Definition CLIOptions.hpp:44
ServeParams serve
Definition CLIOptions.hpp:40
SimulateParams simulation
Definition CLIOptions.hpp:37
EvaluateParams evaluate
Definition CLIOptions.hpp:38
nlohmann::json to_json() const
Serialize to a JSON config (round-trips with the JSON constructor).
Subcommand subcommand
Definition CLIOptions.hpp:34
void resolve()
Resolve intermediate representations into final form.
stats::DataPacket read_data(stats::RNG &rng)
Load the training data: from the --data CSV when set, or simulated from --simulate params otherwise.
std::string output_path
Definition CLIOptions.hpp:45
bool quiet
Definition CLIOptions.hpp:47
void resolve_defaults(unsigned int total_vars)
Fill in runtime defaults (seed, threads, vars, strategy configs).
ModelParams model
Definition CLIOptions.hpp:36
Params(nlohmann::json const &config)
Construct from a JSON config object.
bool no_color
Definition CLIOptions.hpp:50
BenchmarkParams benchmark
Definition CLIOptions.hpp:39
serve subcommand options. CLI-exclusive; no config file roundtrip.
Definition ServeParams.hpp:13
Simulation data source options.
Definition EvaluateParams.hpp:16
Quiet-aware, indentation-aware output context.
Definition Output.hpp:25
Bundled dataset: features, response, and group labels.
Definition DataPacket.hpp:19