ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
ppforest2::cli::ModelParams Struct Reference

Model training parameters shared by train and evaluate. More...

#include <ModelParams.hpp>

Public Member Functions

 ModelParams ()=default
 
 ModelParams (nlohmann::json const &config)
 Construct from a JSON config object.
 
void resolve ()
 Parse strategy input strings and p_vars input into their final form.
 
void resolve_defaults (unsigned int total_vars)
 Fill in runtime defaults (threads, vars, strategy configs).
 
nlohmann::json to_json () const
 Serialize to JSON config.
 

Static Public Member Functions

static void validate (nlohmann::json const &config, std::vector< std::string > &errors)
 Validate model-related fields in a JSON config.
 

Public Attributes

nlohmann::json binarize_config
 
std::string binarize_input
 
nlohmann::json cutpoint_config
 
std::string cutpoint_input
 
nlohmann::json grouping_config
 
std::string grouping_input
 
float lambda = 0.0
 
nlohmann::json leaf_config
 
std::string leaf_input
 
int max_retries = 3
 
std::string mode_input
 Training mode ("classification" or "regression").
 
std::optional< int > n_vars
 
std::optional< float > p_vars
 
std::string p_vars_input
 
nlohmann::json pp_config
 Strategy JSON objects (from CLI strings or config file).
 
std::string pp_input
 Explicit strategy inputs (–X flags).
 
std::optional< int > seed
 
int size = 100
 
nlohmann::json stop_config
 
std::vector< std::string > stop_inputs
 Repeated --stop flag values.
 
std::optional< int > threads
 
nlohmann::json vars_config
 
std::string vars_input
 

Detailed Description

Model training parameters shared by train and evaluate.

Constructor & Destructor Documentation

◆ ModelParams() [1/2]

ppforest2::cli::ModelParams::ModelParams ( )
default

◆ ModelParams() [2/2]

ppforest2::cli::ModelParams::ModelParams ( nlohmann::json const & config)
explicit

Construct from a JSON config object.

Member Function Documentation

◆ resolve()

void ppforest2::cli::ModelParams::resolve ( )

Parse strategy input strings and p_vars input into their final form.

◆ resolve_defaults()

void ppforest2::cli::ModelParams::resolve_defaults ( unsigned int total_vars)

Fill in runtime defaults (threads, vars, strategy configs).

◆ to_json()

nlohmann::json ppforest2::cli::ModelParams::to_json ( ) const

Serialize to JSON config.

◆ validate()

static void ppforest2::cli::ModelParams::validate ( nlohmann::json const & config,
std::vector< std::string > & errors )
static

Validate model-related fields in a JSON config.

Member Data Documentation

◆ binarize_config

nlohmann::json ppforest2::cli::ModelParams::binarize_config

◆ binarize_input

std::string ppforest2::cli::ModelParams::binarize_input

◆ cutpoint_config

nlohmann::json ppforest2::cli::ModelParams::cutpoint_config

◆ cutpoint_input

std::string ppforest2::cli::ModelParams::cutpoint_input

◆ grouping_config

nlohmann::json ppforest2::cli::ModelParams::grouping_config

◆ grouping_input

std::string ppforest2::cli::ModelParams::grouping_input

◆ lambda

float ppforest2::cli::ModelParams::lambda = 0.0

◆ leaf_config

nlohmann::json ppforest2::cli::ModelParams::leaf_config

◆ leaf_input

std::string ppforest2::cli::ModelParams::leaf_input

◆ max_retries

int ppforest2::cli::ModelParams::max_retries = 3

◆ mode_input

std::string ppforest2::cli::ModelParams::mode_input

Training mode ("classification" or "regression").

Empty default = "infer from data": for --data, the CSV reader detects regression from fractional y values and read_data populates this; for --simulate, no data exists yet so we fall back to "classification". -m,--mode overrides both paths.

◆ n_vars

std::optional<int> ppforest2::cli::ModelParams::n_vars

◆ p_vars

std::optional<float> ppforest2::cli::ModelParams::p_vars

◆ p_vars_input

std::string ppforest2::cli::ModelParams::p_vars_input

◆ pp_config

nlohmann::json ppforest2::cli::ModelParams::pp_config

Strategy JSON objects (from CLI strings or config file).

◆ pp_input

std::string ppforest2::cli::ModelParams::pp_input

Explicit strategy inputs (–X flags).

◆ seed

std::optional<int> ppforest2::cli::ModelParams::seed

◆ size

int ppforest2::cli::ModelParams::size = 100

◆ stop_config

nlohmann::json ppforest2::cli::ModelParams::stop_config

◆ stop_inputs

std::vector<std::string> ppforest2::cli::ModelParams::stop_inputs

Repeated --stop flag values.

The only strategy flag that accepts repeats: multiple occurrences collect into this vector and are composed into a CompositeStop any-rule at resolve() time. A single --stop behaves unchanged.

◆ threads

std::optional<int> ppforest2::cli::ModelParams::threads

◆ vars_config

nlohmann::json ppforest2::cli::ModelParams::vars_config

◆ vars_input

std::string ppforest2::cli::ModelParams::vars_input

The documentation for this struct was generated from the following file: