in src/io/config_auto.cpp [321:646]
void Config::GetMembersFromString(const std::unordered_map<std::string, std::string>& params) {
std::string tmp_str = "";
GetString(params, "data", &data);
if (GetString(params, "valid", &tmp_str)) {
valid = Common::Split(tmp_str.c_str(), ',');
}
GetInt(params, "num_iterations", &num_iterations);
CHECK_GE(num_iterations, 0);
GetDouble(params, "learning_rate", &learning_rate);
CHECK_GT(learning_rate, 0.0);
GetInt(params, "num_leaves", &num_leaves);
CHECK_GT(num_leaves, 1);
CHECK_LE(num_leaves, 131072);
GetInt(params, "num_threads", &num_threads);
GetBool(params, "deterministic", &deterministic);
GetBool(params, "force_col_wise", &force_col_wise);
GetBool(params, "force_row_wise", &force_row_wise);
GetDouble(params, "histogram_pool_size", &histogram_pool_size);
GetInt(params, "max_depth", &max_depth);
GetInt(params, "min_data_in_leaf", &min_data_in_leaf);
CHECK_GE(min_data_in_leaf, 0);
GetDouble(params, "min_sum_hessian_in_leaf", &min_sum_hessian_in_leaf);
CHECK_GE(min_sum_hessian_in_leaf, 0.0);
GetDouble(params, "bagging_fraction", &bagging_fraction);
CHECK_GT(bagging_fraction, 0.0);
CHECK_LE(bagging_fraction, 1.0);
GetDouble(params, "pos_bagging_fraction", &pos_bagging_fraction);
CHECK_GT(pos_bagging_fraction, 0.0);
CHECK_LE(pos_bagging_fraction, 1.0);
GetDouble(params, "neg_bagging_fraction", &neg_bagging_fraction);
CHECK_GT(neg_bagging_fraction, 0.0);
CHECK_LE(neg_bagging_fraction, 1.0);
GetInt(params, "bagging_freq", &bagging_freq);
GetInt(params, "bagging_seed", &bagging_seed);
GetDouble(params, "feature_fraction", &feature_fraction);
CHECK_GT(feature_fraction, 0.0);
CHECK_LE(feature_fraction, 1.0);
GetDouble(params, "feature_fraction_bynode", &feature_fraction_bynode);
CHECK_GT(feature_fraction_bynode, 0.0);
CHECK_LE(feature_fraction_bynode, 1.0);
GetInt(params, "feature_fraction_seed", &feature_fraction_seed);
GetBool(params, "extra_trees", &extra_trees);
GetInt(params, "extra_seed", &extra_seed);
GetInt(params, "early_stopping_round", &early_stopping_round);
GetBool(params, "first_metric_only", &first_metric_only);
GetDouble(params, "max_delta_step", &max_delta_step);
GetDouble(params, "lambda_l1", &lambda_l1);
CHECK_GE(lambda_l1, 0.0);
GetDouble(params, "lambda_l2", &lambda_l2);
CHECK_GE(lambda_l2, 0.0);
GetDouble(params, "linear_lambda", &linear_lambda);
CHECK_GE(linear_lambda, 0.0);
GetDouble(params, "min_gain_to_split", &min_gain_to_split);
CHECK_GE(min_gain_to_split, 0.0);
GetDouble(params, "drop_rate", &drop_rate);
CHECK_GE(drop_rate, 0.0);
CHECK_LE(drop_rate, 1.0);
GetInt(params, "max_drop", &max_drop);
GetDouble(params, "skip_drop", &skip_drop);
CHECK_GE(skip_drop, 0.0);
CHECK_LE(skip_drop, 1.0);
GetBool(params, "xgboost_dart_mode", &xgboost_dart_mode);
GetBool(params, "uniform_drop", &uniform_drop);
GetInt(params, "drop_seed", &drop_seed);
GetDouble(params, "top_rate", &top_rate);
CHECK_GE(top_rate, 0.0);
CHECK_LE(top_rate, 1.0);
GetDouble(params, "other_rate", &other_rate);
CHECK_GE(other_rate, 0.0);
CHECK_LE(other_rate, 1.0);
GetInt(params, "min_data_per_group", &min_data_per_group);
CHECK_GT(min_data_per_group, 0);
GetInt(params, "max_cat_threshold", &max_cat_threshold);
CHECK_GT(max_cat_threshold, 0);
GetDouble(params, "cat_l2", &cat_l2);
CHECK_GE(cat_l2, 0.0);
GetDouble(params, "cat_smooth", &cat_smooth);
CHECK_GE(cat_smooth, 0.0);
GetInt(params, "max_cat_to_onehot", &max_cat_to_onehot);
CHECK_GT(max_cat_to_onehot, 0);
GetInt(params, "top_k", &top_k);
CHECK_GT(top_k, 0);
if (GetString(params, "monotone_constraints", &tmp_str)) {
monotone_constraints = Common::StringToArray<int8_t>(tmp_str, ',');
}
GetString(params, "monotone_constraints_method", &monotone_constraints_method);
GetDouble(params, "monotone_penalty", &monotone_penalty);
CHECK_GE(monotone_penalty, 0.0);
if (GetString(params, "feature_contri", &tmp_str)) {
feature_contri = Common::StringToArray<double>(tmp_str, ',');
}
GetString(params, "forcedsplits_filename", &forcedsplits_filename);
GetDouble(params, "refit_decay_rate", &refit_decay_rate);
CHECK_GE(refit_decay_rate, 0.0);
CHECK_LE(refit_decay_rate, 1.0);
GetDouble(params, "cegb_tradeoff", &cegb_tradeoff);
CHECK_GE(cegb_tradeoff, 0.0);
GetDouble(params, "cegb_penalty_split", &cegb_penalty_split);
CHECK_GE(cegb_penalty_split, 0.0);
if (GetString(params, "cegb_penalty_feature_lazy", &tmp_str)) {
cegb_penalty_feature_lazy = Common::StringToArray<double>(tmp_str, ',');
}
if (GetString(params, "cegb_penalty_feature_coupled", &tmp_str)) {
cegb_penalty_feature_coupled = Common::StringToArray<double>(tmp_str, ',');
}
GetDouble(params, "path_smooth", &path_smooth);
CHECK_GE(path_smooth, 0.0);
GetString(params, "interaction_constraints", &interaction_constraints);
GetInt(params, "verbosity", &verbosity);
GetString(params, "input_model", &input_model);
GetString(params, "output_model", &output_model);
GetInt(params, "saved_feature_importance_type", &saved_feature_importance_type);
GetInt(params, "snapshot_freq", &snapshot_freq);
GetBool(params, "linear_tree", &linear_tree);
GetInt(params, "max_bin", &max_bin);
CHECK_GT(max_bin, 1);
if (GetString(params, "max_bin_by_feature", &tmp_str)) {
max_bin_by_feature = Common::StringToArray<int32_t>(tmp_str, ',');
}
GetInt(params, "min_data_in_bin", &min_data_in_bin);
CHECK_GT(min_data_in_bin, 0);
GetInt(params, "bin_construct_sample_cnt", &bin_construct_sample_cnt);
CHECK_GT(bin_construct_sample_cnt, 0);
GetInt(params, "data_random_seed", &data_random_seed);
GetBool(params, "is_enable_sparse", &is_enable_sparse);
GetBool(params, "enable_bundle", &enable_bundle);
GetBool(params, "use_missing", &use_missing);
GetBool(params, "zero_as_missing", &zero_as_missing);
GetBool(params, "feature_pre_filter", &feature_pre_filter);
GetBool(params, "pre_partition", &pre_partition);
GetBool(params, "two_round", &two_round);
GetBool(params, "header", &header);
GetString(params, "label_column", &label_column);
GetString(params, "weight_column", &weight_column);
GetString(params, "group_column", &group_column);
GetString(params, "ignore_column", &ignore_column);
GetString(params, "categorical_feature", &categorical_feature);
GetString(params, "forcedbins_filename", &forcedbins_filename);
GetBool(params, "save_binary", &save_binary);
GetBool(params, "precise_float_parser", &precise_float_parser);
GetString(params, "parser_config_file", &parser_config_file);
GetInt(params, "start_iteration_predict", &start_iteration_predict);
GetInt(params, "num_iteration_predict", &num_iteration_predict);
GetBool(params, "predict_raw_score", &predict_raw_score);
GetBool(params, "predict_leaf_index", &predict_leaf_index);
GetBool(params, "predict_contrib", &predict_contrib);
GetBool(params, "predict_disable_shape_check", &predict_disable_shape_check);
GetBool(params, "pred_early_stop", &pred_early_stop);
GetInt(params, "pred_early_stop_freq", &pred_early_stop_freq);
GetDouble(params, "pred_early_stop_margin", &pred_early_stop_margin);
GetString(params, "output_result", &output_result);
GetString(params, "convert_model_language", &convert_model_language);
GetString(params, "convert_model", &convert_model);
GetInt(params, "objective_seed", &objective_seed);
GetInt(params, "num_class", &num_class);
CHECK_GT(num_class, 0);
GetBool(params, "is_unbalance", &is_unbalance);
GetDouble(params, "scale_pos_weight", &scale_pos_weight);
CHECK_GT(scale_pos_weight, 0.0);
GetDouble(params, "sigmoid", &sigmoid);
CHECK_GT(sigmoid, 0.0);
GetBool(params, "boost_from_average", &boost_from_average);
GetBool(params, "reg_sqrt", ®_sqrt);
GetDouble(params, "alpha", &alpha);
CHECK_GT(alpha, 0.0);
GetDouble(params, "fair_c", &fair_c);
CHECK_GT(fair_c, 0.0);
GetDouble(params, "poisson_max_delta_step", &poisson_max_delta_step);
CHECK_GT(poisson_max_delta_step, 0.0);
GetDouble(params, "tweedie_variance_power", &tweedie_variance_power);
CHECK_GE(tweedie_variance_power, 1.0);
CHECK_LT(tweedie_variance_power, 2.0);
GetInt(params, "lambdarank_truncation_level", &lambdarank_truncation_level);
CHECK_GT(lambdarank_truncation_level, 0);
GetBool(params, "lambdarank_norm", &lambdarank_norm);
if (GetString(params, "label_gain", &tmp_str)) {
label_gain = Common::StringToArray<double>(tmp_str, ',');
}
GetInt(params, "metric_freq", &metric_freq);
CHECK_GT(metric_freq, 0);
GetBool(params, "is_provide_training_metric", &is_provide_training_metric);
if (GetString(params, "eval_at", &tmp_str)) {
eval_at = Common::StringToArray<int>(tmp_str, ',');
}
GetInt(params, "multi_error_top_k", &multi_error_top_k);
CHECK_GT(multi_error_top_k, 0);
if (GetString(params, "auc_mu_weights", &tmp_str)) {
auc_mu_weights = Common::StringToArray<double>(tmp_str, ',');
}
GetInt(params, "num_machines", &num_machines);
CHECK_GT(num_machines, 0);
GetInt(params, "local_listen_port", &local_listen_port);
CHECK_GT(local_listen_port, 0);
GetInt(params, "time_out", &time_out);
CHECK_GT(time_out, 0);
GetString(params, "machine_list_filename", &machine_list_filename);
GetString(params, "machines", &machines);
GetInt(params, "gpu_platform_id", &gpu_platform_id);
GetInt(params, "gpu_device_id", &gpu_device_id);
GetBool(params, "gpu_use_dp", &gpu_use_dp);
GetInt(params, "num_gpu", &num_gpu);
CHECK_GT(num_gpu, 0);
}