config_auto.cpp 38.3 KB
Newer Older
1
2
3
4
5
/*!
 * Copyright (c) 2018 Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See LICENSE file in the project root for license information.
 *
 * \note
6
 * This file is auto generated by LightGBM\.ci\parameter-generator.py from LightGBM\include\LightGBM\config.h file.
7
 */
8
9
10
11
12
13
14
#include <LightGBM/config.h>

#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

Guolin Ke's avatar
Guolin Ke committed
15
namespace LightGBM {
jcipar's avatar
jcipar committed
16
17
const std::unordered_map<std::string, std::string>& Config::alias_table() {
  static std::unordered_map<std::string, std::string> aliases({
18
19
20
21
22
  {"config_file", "config"},
  {"task_type", "task"},
  {"objective_type", "objective"},
  {"app", "objective"},
  {"application", "objective"},
23
  {"loss", "objective"},
24
25
26
27
  {"boosting_type", "boosting"},
  {"boost", "boosting"},
  {"train", "data"},
  {"train_data", "data"},
28
  {"train_data_file", "data"},
29
30
31
32
33
  {"data_filename", "data"},
  {"test", "valid"},
  {"valid_data", "valid"},
  {"valid_data_file", "valid"},
  {"test_data", "valid"},
34
  {"test_data_file", "valid"},
35
36
  {"valid_filenames", "valid"},
  {"num_iteration", "num_iterations"},
37
  {"n_iter", "num_iterations"},
38
39
40
41
  {"num_tree", "num_iterations"},
  {"num_trees", "num_iterations"},
  {"num_round", "num_iterations"},
  {"num_rounds", "num_iterations"},
42
  {"nrounds", "num_iterations"},
43
44
  {"num_boost_round", "num_iterations"},
  {"n_estimators", "num_iterations"},
45
  {"max_iter", "num_iterations"},
46
  {"shrinkage_rate", "learning_rate"},
47
  {"eta", "learning_rate"},
48
  {"num_leaf", "num_leaves"},
49
50
  {"max_leaves", "num_leaves"},
  {"max_leaf", "num_leaves"},
51
  {"max_leaf_nodes", "num_leaves"},
52
  {"tree", "tree_learner"},
53
  {"tree_type", "tree_learner"},
54
55
56
57
  {"tree_learner_type", "tree_learner"},
  {"num_thread", "num_threads"},
  {"nthread", "num_threads"},
  {"nthreads", "num_threads"},
58
  {"n_jobs", "num_threads"},
59
  {"device", "device_type"},
60
  {"random_seed", "seed"},
61
  {"random_state", "seed"},
62
  {"hist_pool_size", "histogram_pool_size"},
63
64
65
  {"min_data_per_leaf", "min_data_in_leaf"},
  {"min_data", "min_data_in_leaf"},
  {"min_child_samples", "min_data_in_leaf"},
66
  {"min_samples_leaf", "min_data_in_leaf"},
67
68
69
70
71
72
73
  {"min_sum_hessian_per_leaf", "min_sum_hessian_in_leaf"},
  {"min_sum_hessian", "min_sum_hessian_in_leaf"},
  {"min_hessian", "min_sum_hessian_in_leaf"},
  {"min_child_weight", "min_sum_hessian_in_leaf"},
  {"sub_row", "bagging_fraction"},
  {"subsample", "bagging_fraction"},
  {"bagging", "bagging_fraction"},
Guolin Ke's avatar
Guolin Ke committed
74
75
76
77
78
79
  {"pos_sub_row", "pos_bagging_fraction"},
  {"pos_subsample", "pos_bagging_fraction"},
  {"pos_bagging", "pos_bagging_fraction"},
  {"neg_sub_row", "neg_bagging_fraction"},
  {"neg_subsample", "neg_bagging_fraction"},
  {"neg_bagging", "neg_bagging_fraction"},
80
81
82
83
  {"subsample_freq", "bagging_freq"},
  {"bagging_fraction_seed", "bagging_seed"},
  {"sub_feature", "feature_fraction"},
  {"colsample_bytree", "feature_fraction"},
84
85
  {"sub_feature_bynode", "feature_fraction_bynode"},
  {"colsample_bynode", "feature_fraction_bynode"},
Nikita Titov's avatar
Nikita Titov committed
86
  {"extra_tree", "extra_trees"},
87
88
  {"early_stopping_rounds", "early_stopping_round"},
  {"early_stopping", "early_stopping_round"},
89
  {"n_iter_no_change", "early_stopping_round"},
90
91
92
  {"max_tree_output", "max_delta_step"},
  {"max_leaf_output", "max_delta_step"},
  {"reg_alpha", "lambda_l1"},
93
  {"l1_regularization", "lambda_l1"},
94
  {"reg_lambda", "lambda_l2"},
95
  {"lambda", "lambda_l2"},
96
  {"l2_regularization", "lambda_l2"},
97
  {"min_split_gain", "min_gain_to_split"},
98
  {"rate_drop", "drop_rate"},
99
100
101
  {"topk", "top_k"},
  {"mc", "monotone_constraints"},
  {"monotone_constraint", "monotone_constraints"},
102
  {"monotonic_cst", "monotone_constraints"},
103
104
  {"monotone_constraining_method", "monotone_constraints_method"},
  {"mc_method", "monotone_constraints_method"},
105
106
107
  {"monotone_splits_penalty", "monotone_penalty"},
  {"ms_penalty", "monotone_penalty"},
  {"mc_penalty", "monotone_penalty"},
108
  {"feature_contrib", "feature_contri"},
Guolin Ke's avatar
Guolin Ke committed
109
110
111
  {"fc", "feature_contri"},
  {"fp", "feature_contri"},
  {"feature_penalty", "feature_contri"},
112
113
114
115
116
  {"fs", "forcedsplits_filename"},
  {"forced_splits_filename", "forcedsplits_filename"},
  {"forced_splits_file", "forcedsplits_filename"},
  {"forced_splits", "forcedsplits_filename"},
  {"verbose", "verbosity"},
117
118
  {"model_input", "input_model"},
  {"model_in", "input_model"},
119
120
  {"model_output", "output_model"},
  {"model_out", "output_model"},
121
  {"save_period", "snapshot_freq"},
Nikita Titov's avatar
Nikita Titov committed
122
  {"linear_trees", "linear_tree"},
123
  {"max_bins", "max_bin"},
124
125
126
127
128
  {"subsample_for_bin", "bin_construct_sample_cnt"},
  {"data_seed", "data_random_seed"},
  {"is_sparse", "is_enable_sparse"},
  {"enable_sparse", "is_enable_sparse"},
  {"sparse", "is_enable_sparse"},
129
130
  {"is_enable_bundle", "enable_bundle"},
  {"bundle", "enable_bundle"},
131
  {"is_pre_partition", "pre_partition"},
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
  {"two_round_loading", "two_round"},
  {"use_two_round_loading", "two_round"},
  {"has_header", "header"},
  {"label", "label_column"},
  {"weight", "weight_column"},
  {"group", "group_column"},
  {"group_id", "group_column"},
  {"query_column", "group_column"},
  {"query", "group_column"},
  {"query_id", "group_column"},
  {"ignore_feature", "ignore_column"},
  {"blacklist", "ignore_column"},
  {"cat_feature", "categorical_feature"},
  {"categorical_column", "categorical_feature"},
  {"cat_column", "categorical_feature"},
147
  {"categorical_features", "categorical_feature"},
148
149
  {"is_save_binary", "save_binary"},
  {"is_save_binary_file", "save_binary"},
150
151
152
153
154
155
156
  {"is_predict_raw_score", "predict_raw_score"},
  {"predict_rawscore", "predict_raw_score"},
  {"raw_score", "predict_raw_score"},
  {"is_predict_leaf_index", "predict_leaf_index"},
  {"leaf_index", "predict_leaf_index"},
  {"is_predict_contrib", "predict_contrib"},
  {"contrib", "predict_contrib"},
157
158
159
160
161
162
  {"predict_result", "output_result"},
  {"prediction_result", "output_result"},
  {"predict_name", "output_result"},
  {"prediction_name", "output_result"},
  {"pred_name", "output_result"},
  {"name_pred", "output_result"},
163
164
  {"convert_model_file", "convert_model"},
  {"num_classes", "num_class"},
165
  {"unbalance", "is_unbalance"},
166
167
168
169
170
171
172
173
174
  {"unbalanced_sets", "is_unbalance"},
  {"metrics", "metric"},
  {"metric_types", "metric"},
  {"output_freq", "metric_freq"},
  {"training_metric", "is_provide_training_metric"},
  {"is_training_metric", "is_provide_training_metric"},
  {"train_metric", "is_provide_training_metric"},
  {"ndcg_eval_at", "eval_at"},
  {"ndcg_at", "eval_at"},
175
176
  {"map_eval_at", "eval_at"},
  {"map_at", "eval_at"},
177
178
179
180
181
182
183
184
  {"num_machine", "num_machines"},
  {"local_port", "local_listen_port"},
  {"port", "local_listen_port"},
  {"machine_list_file", "machine_list_filename"},
  {"machine_list", "machine_list_filename"},
  {"mlist", "machine_list_filename"},
  {"workers", "machines"},
  {"nodes", "machines"},
jcipar's avatar
jcipar committed
185
186
187
  });
  return aliases;
}
Guolin Ke's avatar
Guolin Ke committed
188

jcipar's avatar
jcipar committed
189
190
const std::unordered_set<std::string>& Config::parameter_set() {
  static std::unordered_set<std::string> params({
191
192
193
194
  "config",
  "task",
  "objective",
  "boosting",
195
  "data_sample_strategy",
196
197
198
199
200
201
202
203
204
  "data",
  "valid",
  "num_iterations",
  "learning_rate",
  "num_leaves",
  "tree_learner",
  "num_threads",
  "device_type",
  "seed",
Guolin Ke's avatar
Guolin Ke committed
205
  "deterministic",
206
207
  "force_col_wise",
  "force_row_wise",
208
  "histogram_pool_size",
209
210
211
212
  "max_depth",
  "min_data_in_leaf",
  "min_sum_hessian_in_leaf",
  "bagging_fraction",
Guolin Ke's avatar
Guolin Ke committed
213
214
  "pos_bagging_fraction",
  "neg_bagging_fraction",
215
216
  "bagging_freq",
  "bagging_seed",
217
  "bagging_by_query",
218
  "feature_fraction",
219
  "feature_fraction_bynode",
220
  "feature_fraction_seed",
221
222
  "extra_trees",
  "extra_seed",
223
  "early_stopping_round",
224
  "early_stopping_min_delta",
225
  "first_metric_only",
226
227
228
  "max_delta_step",
  "lambda_l1",
  "lambda_l2",
229
  "linear_lambda",
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
  "min_gain_to_split",
  "drop_rate",
  "max_drop",
  "skip_drop",
  "xgboost_dart_mode",
  "uniform_drop",
  "drop_seed",
  "top_rate",
  "other_rate",
  "min_data_per_group",
  "max_cat_threshold",
  "cat_l2",
  "cat_smooth",
  "max_cat_to_onehot",
  "top_k",
  "monotone_constraints",
246
  "monotone_constraints_method",
247
  "monotone_penalty",
Guolin Ke's avatar
Guolin Ke committed
248
  "feature_contri",
249
  "forcedsplits_filename",
Guolin Ke's avatar
Guolin Ke committed
250
  "refit_decay_rate",
251
252
253
254
  "cegb_tradeoff",
  "cegb_penalty_split",
  "cegb_penalty_feature_lazy",
  "cegb_penalty_feature_coupled",
Belinda Trotta's avatar
Belinda Trotta committed
255
  "path_smooth",
256
  "interaction_constraints",
257
  "verbosity",
258
259
  "input_model",
  "output_model",
260
  "saved_feature_importance_type",
261
  "snapshot_freq",
262
263
264
265
  "use_quantized_grad",
  "num_grad_quant_bins",
  "quant_train_renew_leaf",
  "stochastic_rounding",
Nikita Titov's avatar
Nikita Titov committed
266
  "linear_tree",
267
  "max_bin",
Belinda Trotta's avatar
Belinda Trotta committed
268
  "max_bin_by_feature",
269
270
271
  "min_data_in_bin",
  "bin_construct_sample_cnt",
  "data_random_seed",
272
  "is_enable_sparse",
273
274
275
  "enable_bundle",
  "use_missing",
  "zero_as_missing",
276
277
  "feature_pre_filter",
  "pre_partition",
278
279
280
281
282
283
284
  "two_round",
  "header",
  "label_column",
  "weight_column",
  "group_column",
  "ignore_column",
  "categorical_feature",
285
286
  "forcedbins_filename",
  "save_binary",
Chen Yufei's avatar
Chen Yufei committed
287
  "precise_float_parser",
288
  "parser_config_file",
289
  "start_iteration_predict",
290
  "num_iteration_predict",
291
292
293
  "predict_raw_score",
  "predict_leaf_index",
  "predict_contrib",
294
  "predict_disable_shape_check",
295
296
297
  "pred_early_stop",
  "pred_early_stop_freq",
  "pred_early_stop_margin",
298
  "output_result",
299
300
  "convert_model_language",
  "convert_model",
301
  "objective_seed",
302
303
304
305
306
307
308
309
310
311
  "num_class",
  "is_unbalance",
  "scale_pos_weight",
  "sigmoid",
  "boost_from_average",
  "reg_sqrt",
  "alpha",
  "fair_c",
  "poisson_max_delta_step",
  "tweedie_variance_power",
312
313
  "lambdarank_truncation_level",
  "lambdarank_norm",
314
  "label_gain",
315
  "lambdarank_position_bias_regularization",
316
317
318
319
  "metric",
  "metric_freq",
  "is_provide_training_metric",
  "eval_at",
Belinda Trotta's avatar
Belinda Trotta committed
320
  "multi_error_top_k",
Belinda Trotta's avatar
Belinda Trotta committed
321
  "auc_mu_weights",
322
323
324
325
326
327
328
329
  "num_machines",
  "local_listen_port",
  "time_out",
  "machine_list_filename",
  "machines",
  "gpu_platform_id",
  "gpu_device_id",
  "gpu_use_dp",
330
  "num_gpu",
jcipar's avatar
jcipar committed
331
332
333
  });
  return params;
}
Guolin Ke's avatar
Guolin Ke committed
334
335
336
337
338
339
340
341
342
343

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);
344
  CHECK_GE(num_iterations, 0);
Guolin Ke's avatar
Guolin Ke committed
345
346

  GetDouble(params, "learning_rate", &learning_rate);
347
  CHECK_GT(learning_rate, 0.0);
Guolin Ke's avatar
Guolin Ke committed
348
349

  GetInt(params, "num_leaves", &num_leaves);
350
351
  CHECK_GT(num_leaves, 1);
  CHECK_LE(num_leaves, 131072);
Guolin Ke's avatar
Guolin Ke committed
352
353
354

  GetInt(params, "num_threads", &num_threads);

Guolin Ke's avatar
Guolin Ke committed
355
356
  GetBool(params, "deterministic", &deterministic);

357
358
359
360
  GetBool(params, "force_col_wise", &force_col_wise);

  GetBool(params, "force_row_wise", &force_row_wise);

361
362
  GetDouble(params, "histogram_pool_size", &histogram_pool_size);

Guolin Ke's avatar
Guolin Ke committed
363
364
365
  GetInt(params, "max_depth", &max_depth);

  GetInt(params, "min_data_in_leaf", &min_data_in_leaf);
366
  CHECK_GE(min_data_in_leaf, 0);
Guolin Ke's avatar
Guolin Ke committed
367
368

  GetDouble(params, "min_sum_hessian_in_leaf", &min_sum_hessian_in_leaf);
369
  CHECK_GE(min_sum_hessian_in_leaf, 0.0);
Guolin Ke's avatar
Guolin Ke committed
370
371

  GetDouble(params, "bagging_fraction", &bagging_fraction);
372
373
  CHECK_GT(bagging_fraction, 0.0);
  CHECK_LE(bagging_fraction, 1.0);
Guolin Ke's avatar
Guolin Ke committed
374

Guolin Ke's avatar
Guolin Ke committed
375
  GetDouble(params, "pos_bagging_fraction", &pos_bagging_fraction);
376
377
  CHECK_GT(pos_bagging_fraction, 0.0);
  CHECK_LE(pos_bagging_fraction, 1.0);
Guolin Ke's avatar
Guolin Ke committed
378
379

  GetDouble(params, "neg_bagging_fraction", &neg_bagging_fraction);
380
381
  CHECK_GT(neg_bagging_fraction, 0.0);
  CHECK_LE(neg_bagging_fraction, 1.0);
Guolin Ke's avatar
Guolin Ke committed
382

Guolin Ke's avatar
Guolin Ke committed
383
384
385
386
  GetInt(params, "bagging_freq", &bagging_freq);

  GetInt(params, "bagging_seed", &bagging_seed);

387
388
  GetBool(params, "bagging_by_query", &bagging_by_query);

Guolin Ke's avatar
Guolin Ke committed
389
  GetDouble(params, "feature_fraction", &feature_fraction);
390
391
  CHECK_GT(feature_fraction, 0.0);
  CHECK_LE(feature_fraction, 1.0);
Guolin Ke's avatar
Guolin Ke committed
392

393
  GetDouble(params, "feature_fraction_bynode", &feature_fraction_bynode);
394
395
  CHECK_GT(feature_fraction_bynode, 0.0);
  CHECK_LE(feature_fraction_bynode, 1.0);
396

Guolin Ke's avatar
Guolin Ke committed
397
398
  GetInt(params, "feature_fraction_seed", &feature_fraction_seed);

399
400
401
402
  GetBool(params, "extra_trees", &extra_trees);

  GetInt(params, "extra_seed", &extra_seed);

Guolin Ke's avatar
Guolin Ke committed
403
404
  GetInt(params, "early_stopping_round", &early_stopping_round);

405
406
407
  GetDouble(params, "early_stopping_min_delta", &early_stopping_min_delta);
  CHECK_GE(early_stopping_min_delta, 0.0);

408
409
  GetBool(params, "first_metric_only", &first_metric_only);

Guolin Ke's avatar
Guolin Ke committed
410
411
412
  GetDouble(params, "max_delta_step", &max_delta_step);

  GetDouble(params, "lambda_l1", &lambda_l1);
413
  CHECK_GE(lambda_l1, 0.0);
Guolin Ke's avatar
Guolin Ke committed
414
415

  GetDouble(params, "lambda_l2", &lambda_l2);
416
  CHECK_GE(lambda_l2, 0.0);
Guolin Ke's avatar
Guolin Ke committed
417

418
419
420
  GetDouble(params, "linear_lambda", &linear_lambda);
  CHECK_GE(linear_lambda, 0.0);

Guolin Ke's avatar
Guolin Ke committed
421
  GetDouble(params, "min_gain_to_split", &min_gain_to_split);
422
  CHECK_GE(min_gain_to_split, 0.0);
Guolin Ke's avatar
Guolin Ke committed
423
424

  GetDouble(params, "drop_rate", &drop_rate);
425
426
  CHECK_GE(drop_rate, 0.0);
  CHECK_LE(drop_rate, 1.0);
Guolin Ke's avatar
Guolin Ke committed
427
428
429
430

  GetInt(params, "max_drop", &max_drop);

  GetDouble(params, "skip_drop", &skip_drop);
431
432
  CHECK_GE(skip_drop, 0.0);
  CHECK_LE(skip_drop, 1.0);
Guolin Ke's avatar
Guolin Ke committed
433
434
435
436
437
438
439
440

  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);
441
442
  CHECK_GE(top_rate, 0.0);
  CHECK_LE(top_rate, 1.0);
Guolin Ke's avatar
Guolin Ke committed
443
444

  GetDouble(params, "other_rate", &other_rate);
445
446
  CHECK_GE(other_rate, 0.0);
  CHECK_LE(other_rate, 1.0);
Guolin Ke's avatar
Guolin Ke committed
447
448

  GetInt(params, "min_data_per_group", &min_data_per_group);
449
  CHECK_GT(min_data_per_group, 0);
Guolin Ke's avatar
Guolin Ke committed
450
451

  GetInt(params, "max_cat_threshold", &max_cat_threshold);
452
  CHECK_GT(max_cat_threshold, 0);
Guolin Ke's avatar
Guolin Ke committed
453
454

  GetDouble(params, "cat_l2", &cat_l2);
455
  CHECK_GE(cat_l2, 0.0);
Guolin Ke's avatar
Guolin Ke committed
456
457

  GetDouble(params, "cat_smooth", &cat_smooth);
458
  CHECK_GE(cat_smooth, 0.0);
Guolin Ke's avatar
Guolin Ke committed
459
460

  GetInt(params, "max_cat_to_onehot", &max_cat_to_onehot);
461
  CHECK_GT(max_cat_to_onehot, 0);
Guolin Ke's avatar
Guolin Ke committed
462
463

  GetInt(params, "top_k", &top_k);
464
  CHECK_GT(top_k, 0);
Guolin Ke's avatar
Guolin Ke committed
465
466
467
468
469

  if (GetString(params, "monotone_constraints", &tmp_str)) {
    monotone_constraints = Common::StringToArray<int8_t>(tmp_str, ',');
  }

470
471
  GetString(params, "monotone_constraints_method", &monotone_constraints_method);

472
473
474
  GetDouble(params, "monotone_penalty", &monotone_penalty);
  CHECK_GE(monotone_penalty, 0.0);

Guolin Ke's avatar
Guolin Ke committed
475
476
477
478
  if (GetString(params, "feature_contri", &tmp_str)) {
    feature_contri = Common::StringToArray<double>(tmp_str, ',');
  }

Guolin Ke's avatar
Guolin Ke committed
479
480
  GetString(params, "forcedsplits_filename", &forcedsplits_filename);

Guolin Ke's avatar
Guolin Ke committed
481
  GetDouble(params, "refit_decay_rate", &refit_decay_rate);
482
483
  CHECK_GE(refit_decay_rate, 0.0);
  CHECK_LE(refit_decay_rate, 1.0);
Guolin Ke's avatar
Guolin Ke committed
484

485
  GetDouble(params, "cegb_tradeoff", &cegb_tradeoff);
486
  CHECK_GE(cegb_tradeoff, 0.0);
487
488

  GetDouble(params, "cegb_penalty_split", &cegb_penalty_split);
489
  CHECK_GE(cegb_penalty_split, 0.0);
490
491
492
493
494
495
496
497
498

  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, ',');
  }

Belinda Trotta's avatar
Belinda Trotta committed
499
500
501
  GetDouble(params, "path_smooth", &path_smooth);
  CHECK_GE(path_smooth,  0.0);

502
503
  GetString(params, "interaction_constraints", &interaction_constraints);

504
505
  GetInt(params, "verbosity", &verbosity);

506
507
508
509
  GetString(params, "input_model", &input_model);

  GetString(params, "output_model", &output_model);

510
511
  GetInt(params, "saved_feature_importance_type", &saved_feature_importance_type);

512
513
  GetInt(params, "snapshot_freq", &snapshot_freq);

514
515
516
517
518
519
520
521
  GetBool(params, "use_quantized_grad", &use_quantized_grad);

  GetInt(params, "num_grad_quant_bins", &num_grad_quant_bins);

  GetBool(params, "quant_train_renew_leaf", &quant_train_renew_leaf);

  GetBool(params, "stochastic_rounding", &stochastic_rounding);

Nikita Titov's avatar
Nikita Titov committed
522
523
  GetBool(params, "linear_tree", &linear_tree);

Guolin Ke's avatar
Guolin Ke committed
524
  GetInt(params, "max_bin", &max_bin);
525
  CHECK_GT(max_bin, 1);
Guolin Ke's avatar
Guolin Ke committed
526

Belinda Trotta's avatar
Belinda Trotta committed
527
528
529
530
  if (GetString(params, "max_bin_by_feature", &tmp_str)) {
    max_bin_by_feature = Common::StringToArray<int32_t>(tmp_str, ',');
  }

Guolin Ke's avatar
Guolin Ke committed
531
  GetInt(params, "min_data_in_bin", &min_data_in_bin);
532
  CHECK_GT(min_data_in_bin, 0);
Guolin Ke's avatar
Guolin Ke committed
533

534
  GetInt(params, "bin_construct_sample_cnt", &bin_construct_sample_cnt);
535
  CHECK_GT(bin_construct_sample_cnt, 0);
536

Guolin Ke's avatar
Guolin Ke committed
537
538
  GetInt(params, "data_random_seed", &data_random_seed);

539
  GetBool(params, "is_enable_sparse", &is_enable_sparse);
Guolin Ke's avatar
Guolin Ke committed
540

541
542
543
544
545
  GetBool(params, "enable_bundle", &enable_bundle);

  GetBool(params, "use_missing", &use_missing);

  GetBool(params, "zero_as_missing", &zero_as_missing);
Guolin Ke's avatar
Guolin Ke committed
546

547
  GetBool(params, "feature_pre_filter", &feature_pre_filter);
Guolin Ke's avatar
Guolin Ke committed
548

549
550
551
  GetBool(params, "pre_partition", &pre_partition);

  GetBool(params, "two_round", &two_round);
Guolin Ke's avatar
Guolin Ke committed
552
553
554
555
556
557
558
559
560
561
562
563
564

  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);

565
566
567
568
  GetString(params, "forcedbins_filename", &forcedbins_filename);

  GetBool(params, "save_binary", &save_binary);

Chen Yufei's avatar
Chen Yufei committed
569
570
  GetBool(params, "precise_float_parser", &precise_float_parser);

571
572
  GetString(params, "parser_config_file", &parser_config_file);

573
574
  GetInt(params, "start_iteration_predict", &start_iteration_predict);

575
576
  GetInt(params, "num_iteration_predict", &num_iteration_predict);

Guolin Ke's avatar
Guolin Ke committed
577
578
579
580
581
582
  GetBool(params, "predict_raw_score", &predict_raw_score);

  GetBool(params, "predict_leaf_index", &predict_leaf_index);

  GetBool(params, "predict_contrib", &predict_contrib);

583
  GetBool(params, "predict_disable_shape_check", &predict_disable_shape_check);
Guolin Ke's avatar
Guolin Ke committed
584
585
586
587
588
589
590

  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);

591
  GetString(params, "output_result", &output_result);
592

Guolin Ke's avatar
Guolin Ke committed
593
594
595
596
  GetString(params, "convert_model_language", &convert_model_language);

  GetString(params, "convert_model", &convert_model);

597
598
  GetInt(params, "objective_seed", &objective_seed);

Guolin Ke's avatar
Guolin Ke committed
599
  GetInt(params, "num_class", &num_class);
600
  CHECK_GT(num_class, 0);
Guolin Ke's avatar
Guolin Ke committed
601

602
  GetBool(params, "is_unbalance", &is_unbalance);
Guolin Ke's avatar
Guolin Ke committed
603

604
  GetDouble(params, "scale_pos_weight", &scale_pos_weight);
605
  CHECK_GT(scale_pos_weight, 0.0);
Guolin Ke's avatar
Guolin Ke committed
606

607
  GetDouble(params, "sigmoid", &sigmoid);
608
  CHECK_GT(sigmoid, 0.0);
Guolin Ke's avatar
Guolin Ke committed
609
610
611

  GetBool(params, "boost_from_average", &boost_from_average);

612
  GetBool(params, "reg_sqrt", &reg_sqrt);
Guolin Ke's avatar
Guolin Ke committed
613

614
  GetDouble(params, "alpha", &alpha);
615
  CHECK_GT(alpha, 0.0);
Guolin Ke's avatar
Guolin Ke committed
616

617
  GetDouble(params, "fair_c", &fair_c);
618
  CHECK_GT(fair_c, 0.0);
619
620

  GetDouble(params, "poisson_max_delta_step", &poisson_max_delta_step);
621
  CHECK_GT(poisson_max_delta_step, 0.0);
Guolin Ke's avatar
Guolin Ke committed
622
623

  GetDouble(params, "tweedie_variance_power", &tweedie_variance_power);
624
625
  CHECK_GE(tweedie_variance_power, 1.0);
  CHECK_LT(tweedie_variance_power, 2.0);
626

627
  GetInt(params, "lambdarank_truncation_level", &lambdarank_truncation_level);
628
  CHECK_GT(lambdarank_truncation_level, 0);
Guolin Ke's avatar
Guolin Ke committed
629

630
  GetBool(params, "lambdarank_norm", &lambdarank_norm);
631

Guolin Ke's avatar
Guolin Ke committed
632
633
634
635
  if (GetString(params, "label_gain", &tmp_str)) {
    label_gain = Common::StringToArray<double>(tmp_str, ',');
  }

636
637
638
  GetDouble(params, "lambdarank_position_bias_regularization", &lambdarank_position_bias_regularization);
  CHECK_GE(lambdarank_position_bias_regularization, 0.0);

Guolin Ke's avatar
Guolin Ke committed
639
  GetInt(params, "metric_freq", &metric_freq);
640
  CHECK_GT(metric_freq, 0);
Guolin Ke's avatar
Guolin Ke committed
641
642
643
644
645
646
647

  GetBool(params, "is_provide_training_metric", &is_provide_training_metric);

  if (GetString(params, "eval_at", &tmp_str)) {
    eval_at = Common::StringToArray<int>(tmp_str, ',');
  }

Belinda Trotta's avatar
Belinda Trotta committed
648
  GetInt(params, "multi_error_top_k", &multi_error_top_k);
649
  CHECK_GT(multi_error_top_k, 0);
Belinda Trotta's avatar
Belinda Trotta committed
650

Belinda Trotta's avatar
Belinda Trotta committed
651
652
653
654
  if (GetString(params, "auc_mu_weights", &tmp_str)) {
    auc_mu_weights = Common::StringToArray<double>(tmp_str, ',');
  }

Guolin Ke's avatar
Guolin Ke committed
655
  GetInt(params, "num_machines", &num_machines);
656
  CHECK_GT(num_machines, 0);
Guolin Ke's avatar
Guolin Ke committed
657
658

  GetInt(params, "local_listen_port", &local_listen_port);
659
  CHECK_GT(local_listen_port, 0);
Guolin Ke's avatar
Guolin Ke committed
660
661

  GetInt(params, "time_out", &time_out);
662
  CHECK_GT(time_out, 0);
Guolin Ke's avatar
Guolin Ke committed
663
664
665
666
667
668
669
670
671
672

  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);
673
674
675

  GetInt(params, "num_gpu", &num_gpu);
  CHECK_GT(num_gpu, 0);
Guolin Ke's avatar
Guolin Ke committed
676
677
678
679
}

std::string Config::SaveMembersToString() const {
  std::stringstream str_buf;
680
  str_buf << "[data_sample_strategy: " << data_sample_strategy << "]\n";
Guolin Ke's avatar
Guolin Ke committed
681
  str_buf << "[data: " << data << "]\n";
682
  str_buf << "[valid: " << Common::Join(valid, ",") << "]\n";
Guolin Ke's avatar
Guolin Ke committed
683
684
685
686
  str_buf << "[num_iterations: " << num_iterations << "]\n";
  str_buf << "[learning_rate: " << learning_rate << "]\n";
  str_buf << "[num_leaves: " << num_leaves << "]\n";
  str_buf << "[num_threads: " << num_threads << "]\n";
687
  str_buf << "[seed: " << seed << "]\n";
Guolin Ke's avatar
Guolin Ke committed
688
  str_buf << "[deterministic: " << deterministic << "]\n";
689
690
  str_buf << "[force_col_wise: " << force_col_wise << "]\n";
  str_buf << "[force_row_wise: " << force_row_wise << "]\n";
691
  str_buf << "[histogram_pool_size: " << histogram_pool_size << "]\n";
Guolin Ke's avatar
Guolin Ke committed
692
693
694
695
  str_buf << "[max_depth: " << max_depth << "]\n";
  str_buf << "[min_data_in_leaf: " << min_data_in_leaf << "]\n";
  str_buf << "[min_sum_hessian_in_leaf: " << min_sum_hessian_in_leaf << "]\n";
  str_buf << "[bagging_fraction: " << bagging_fraction << "]\n";
Guolin Ke's avatar
Guolin Ke committed
696
697
  str_buf << "[pos_bagging_fraction: " << pos_bagging_fraction << "]\n";
  str_buf << "[neg_bagging_fraction: " << neg_bagging_fraction << "]\n";
Guolin Ke's avatar
Guolin Ke committed
698
699
  str_buf << "[bagging_freq: " << bagging_freq << "]\n";
  str_buf << "[bagging_seed: " << bagging_seed << "]\n";
700
  str_buf << "[bagging_by_query: " << bagging_by_query << "]\n";
Guolin Ke's avatar
Guolin Ke committed
701
  str_buf << "[feature_fraction: " << feature_fraction << "]\n";
702
  str_buf << "[feature_fraction_bynode: " << feature_fraction_bynode << "]\n";
Guolin Ke's avatar
Guolin Ke committed
703
  str_buf << "[feature_fraction_seed: " << feature_fraction_seed << "]\n";
704
705
  str_buf << "[extra_trees: " << extra_trees << "]\n";
  str_buf << "[extra_seed: " << extra_seed << "]\n";
Guolin Ke's avatar
Guolin Ke committed
706
  str_buf << "[early_stopping_round: " << early_stopping_round << "]\n";
707
  str_buf << "[early_stopping_min_delta: " << early_stopping_min_delta << "]\n";
708
  str_buf << "[first_metric_only: " << first_metric_only << "]\n";
Guolin Ke's avatar
Guolin Ke committed
709
710
711
  str_buf << "[max_delta_step: " << max_delta_step << "]\n";
  str_buf << "[lambda_l1: " << lambda_l1 << "]\n";
  str_buf << "[lambda_l2: " << lambda_l2 << "]\n";
712
  str_buf << "[linear_lambda: " << linear_lambda << "]\n";
Guolin Ke's avatar
Guolin Ke committed
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
  str_buf << "[min_gain_to_split: " << min_gain_to_split << "]\n";
  str_buf << "[drop_rate: " << drop_rate << "]\n";
  str_buf << "[max_drop: " << max_drop << "]\n";
  str_buf << "[skip_drop: " << skip_drop << "]\n";
  str_buf << "[xgboost_dart_mode: " << xgboost_dart_mode << "]\n";
  str_buf << "[uniform_drop: " << uniform_drop << "]\n";
  str_buf << "[drop_seed: " << drop_seed << "]\n";
  str_buf << "[top_rate: " << top_rate << "]\n";
  str_buf << "[other_rate: " << other_rate << "]\n";
  str_buf << "[min_data_per_group: " << min_data_per_group << "]\n";
  str_buf << "[max_cat_threshold: " << max_cat_threshold << "]\n";
  str_buf << "[cat_l2: " << cat_l2 << "]\n";
  str_buf << "[cat_smooth: " << cat_smooth << "]\n";
  str_buf << "[max_cat_to_onehot: " << max_cat_to_onehot << "]\n";
  str_buf << "[top_k: " << top_k << "]\n";
728
  str_buf << "[monotone_constraints: " << Common::Join(Common::ArrayCast<int8_t, int>(monotone_constraints), ",") << "]\n";
729
  str_buf << "[monotone_constraints_method: " << monotone_constraints_method << "]\n";
730
  str_buf << "[monotone_penalty: " << monotone_penalty << "]\n";
731
  str_buf << "[feature_contri: " << Common::Join(feature_contri, ",") << "]\n";
Guolin Ke's avatar
Guolin Ke committed
732
  str_buf << "[forcedsplits_filename: " << forcedsplits_filename << "]\n";
Guolin Ke's avatar
Guolin Ke committed
733
  str_buf << "[refit_decay_rate: " << refit_decay_rate << "]\n";
734
735
736
737
  str_buf << "[cegb_tradeoff: " << cegb_tradeoff << "]\n";
  str_buf << "[cegb_penalty_split: " << cegb_penalty_split << "]\n";
  str_buf << "[cegb_penalty_feature_lazy: " << Common::Join(cegb_penalty_feature_lazy, ",") << "]\n";
  str_buf << "[cegb_penalty_feature_coupled: " << Common::Join(cegb_penalty_feature_coupled, ",") << "]\n";
Belinda Trotta's avatar
Belinda Trotta committed
738
  str_buf << "[path_smooth: " << path_smooth << "]\n";
739
  str_buf << "[interaction_constraints: " << interaction_constraints << "]\n";
740
  str_buf << "[verbosity: " << verbosity << "]\n";
741
  str_buf << "[saved_feature_importance_type: " << saved_feature_importance_type << "]\n";
742
743
744
745
  str_buf << "[use_quantized_grad: " << use_quantized_grad << "]\n";
  str_buf << "[num_grad_quant_bins: " << num_grad_quant_bins << "]\n";
  str_buf << "[quant_train_renew_leaf: " << quant_train_renew_leaf << "]\n";
  str_buf << "[stochastic_rounding: " << stochastic_rounding << "]\n";
Nikita Titov's avatar
Nikita Titov committed
746
  str_buf << "[linear_tree: " << linear_tree << "]\n";
Guolin Ke's avatar
Guolin Ke committed
747
  str_buf << "[max_bin: " << max_bin << "]\n";
Belinda Trotta's avatar
Belinda Trotta committed
748
  str_buf << "[max_bin_by_feature: " << Common::Join(max_bin_by_feature, ",") << "]\n";
Guolin Ke's avatar
Guolin Ke committed
749
  str_buf << "[min_data_in_bin: " << min_data_in_bin << "]\n";
750
  str_buf << "[bin_construct_sample_cnt: " << bin_construct_sample_cnt << "]\n";
Guolin Ke's avatar
Guolin Ke committed
751
  str_buf << "[data_random_seed: " << data_random_seed << "]\n";
752
  str_buf << "[is_enable_sparse: " << is_enable_sparse << "]\n";
753
754
755
  str_buf << "[enable_bundle: " << enable_bundle << "]\n";
  str_buf << "[use_missing: " << use_missing << "]\n";
  str_buf << "[zero_as_missing: " << zero_as_missing << "]\n";
756
757
  str_buf << "[feature_pre_filter: " << feature_pre_filter << "]\n";
  str_buf << "[pre_partition: " << pre_partition << "]\n";
Guolin Ke's avatar
Guolin Ke committed
758
759
760
761
762
763
764
  str_buf << "[two_round: " << two_round << "]\n";
  str_buf << "[header: " << header << "]\n";
  str_buf << "[label_column: " << label_column << "]\n";
  str_buf << "[weight_column: " << weight_column << "]\n";
  str_buf << "[group_column: " << group_column << "]\n";
  str_buf << "[ignore_column: " << ignore_column << "]\n";
  str_buf << "[categorical_feature: " << categorical_feature << "]\n";
765
  str_buf << "[forcedbins_filename: " << forcedbins_filename << "]\n";
Chen Yufei's avatar
Chen Yufei committed
766
  str_buf << "[precise_float_parser: " << precise_float_parser << "]\n";
767
  str_buf << "[parser_config_file: " << parser_config_file << "]\n";
768
  str_buf << "[objective_seed: " << objective_seed << "]\n";
Guolin Ke's avatar
Guolin Ke committed
769
  str_buf << "[num_class: " << num_class << "]\n";
770
771
  str_buf << "[is_unbalance: " << is_unbalance << "]\n";
  str_buf << "[scale_pos_weight: " << scale_pos_weight << "]\n";
Guolin Ke's avatar
Guolin Ke committed
772
  str_buf << "[sigmoid: " << sigmoid << "]\n";
773
774
  str_buf << "[boost_from_average: " << boost_from_average << "]\n";
  str_buf << "[reg_sqrt: " << reg_sqrt << "]\n";
Guolin Ke's avatar
Guolin Ke committed
775
776
777
778
  str_buf << "[alpha: " << alpha << "]\n";
  str_buf << "[fair_c: " << fair_c << "]\n";
  str_buf << "[poisson_max_delta_step: " << poisson_max_delta_step << "]\n";
  str_buf << "[tweedie_variance_power: " << tweedie_variance_power << "]\n";
779
780
  str_buf << "[lambdarank_truncation_level: " << lambdarank_truncation_level << "]\n";
  str_buf << "[lambdarank_norm: " << lambdarank_norm << "]\n";
781
  str_buf << "[label_gain: " << Common::Join(label_gain, ",") << "]\n";
782
  str_buf << "[lambdarank_position_bias_regularization: " << lambdarank_position_bias_regularization << "]\n";
783
  str_buf << "[eval_at: " << Common::Join(eval_at, ",") << "]\n";
Belinda Trotta's avatar
Belinda Trotta committed
784
  str_buf << "[multi_error_top_k: " << multi_error_top_k << "]\n";
Belinda Trotta's avatar
Belinda Trotta committed
785
  str_buf << "[auc_mu_weights: " << Common::Join(auc_mu_weights, ",") << "]\n";
Guolin Ke's avatar
Guolin Ke committed
786
787
788
789
790
791
792
793
  str_buf << "[num_machines: " << num_machines << "]\n";
  str_buf << "[local_listen_port: " << local_listen_port << "]\n";
  str_buf << "[time_out: " << time_out << "]\n";
  str_buf << "[machine_list_filename: " << machine_list_filename << "]\n";
  str_buf << "[machines: " << machines << "]\n";
  str_buf << "[gpu_platform_id: " << gpu_platform_id << "]\n";
  str_buf << "[gpu_device_id: " << gpu_device_id << "]\n";
  str_buf << "[gpu_use_dp: " << gpu_use_dp << "]\n";
794
  str_buf << "[num_gpu: " << num_gpu << "]\n";
Guolin Ke's avatar
Guolin Ke committed
795
796
797
  return str_buf.str();
}

798
799
800
801
802
803
const std::unordered_map<std::string, std::vector<std::string>>& Config::parameter2aliases() {
  static std::unordered_map<std::string, std::vector<std::string>> map({
    {"config", {"config_file"}},
    {"task", {"task_type"}},
    {"objective", {"objective_type", "app", "application", "loss"}},
    {"boosting", {"boosting_type", "boost"}},
804
    {"data_sample_strategy", {}},
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
    {"data", {"train", "train_data", "train_data_file", "data_filename"}},
    {"valid", {"test", "valid_data", "valid_data_file", "test_data", "test_data_file", "valid_filenames"}},
    {"num_iterations", {"num_iteration", "n_iter", "num_tree", "num_trees", "num_round", "num_rounds", "nrounds", "num_boost_round", "n_estimators", "max_iter"}},
    {"learning_rate", {"shrinkage_rate", "eta"}},
    {"num_leaves", {"num_leaf", "max_leaves", "max_leaf", "max_leaf_nodes"}},
    {"tree_learner", {"tree", "tree_type", "tree_learner_type"}},
    {"num_threads", {"num_thread", "nthread", "nthreads", "n_jobs"}},
    {"device_type", {"device"}},
    {"seed", {"random_seed", "random_state"}},
    {"deterministic", {}},
    {"force_col_wise", {}},
    {"force_row_wise", {}},
    {"histogram_pool_size", {"hist_pool_size"}},
    {"max_depth", {}},
    {"min_data_in_leaf", {"min_data_per_leaf", "min_data", "min_child_samples", "min_samples_leaf"}},
    {"min_sum_hessian_in_leaf", {"min_sum_hessian_per_leaf", "min_sum_hessian", "min_hessian", "min_child_weight"}},
    {"bagging_fraction", {"sub_row", "subsample", "bagging"}},
    {"pos_bagging_fraction", {"pos_sub_row", "pos_subsample", "pos_bagging"}},
    {"neg_bagging_fraction", {"neg_sub_row", "neg_subsample", "neg_bagging"}},
    {"bagging_freq", {"subsample_freq"}},
    {"bagging_seed", {"bagging_fraction_seed"}},
826
    {"bagging_by_query", {}},
827
828
829
830
831
832
    {"feature_fraction", {"sub_feature", "colsample_bytree"}},
    {"feature_fraction_bynode", {"sub_feature_bynode", "colsample_bynode"}},
    {"feature_fraction_seed", {}},
    {"extra_trees", {"extra_tree"}},
    {"extra_seed", {}},
    {"early_stopping_round", {"early_stopping_rounds", "early_stopping", "n_iter_no_change"}},
833
    {"early_stopping_min_delta", {}},
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
    {"first_metric_only", {}},
    {"max_delta_step", {"max_tree_output", "max_leaf_output"}},
    {"lambda_l1", {"reg_alpha", "l1_regularization"}},
    {"lambda_l2", {"reg_lambda", "lambda", "l2_regularization"}},
    {"linear_lambda", {}},
    {"min_gain_to_split", {"min_split_gain"}},
    {"drop_rate", {"rate_drop"}},
    {"max_drop", {}},
    {"skip_drop", {}},
    {"xgboost_dart_mode", {}},
    {"uniform_drop", {}},
    {"drop_seed", {}},
    {"top_rate", {}},
    {"other_rate", {}},
    {"min_data_per_group", {}},
    {"max_cat_threshold", {}},
    {"cat_l2", {}},
    {"cat_smooth", {}},
    {"max_cat_to_onehot", {}},
    {"top_k", {"topk"}},
    {"monotone_constraints", {"mc", "monotone_constraint", "monotonic_cst"}},
    {"monotone_constraints_method", {"monotone_constraining_method", "mc_method"}},
    {"monotone_penalty", {"monotone_splits_penalty", "ms_penalty", "mc_penalty"}},
    {"feature_contri", {"feature_contrib", "fc", "fp", "feature_penalty"}},
    {"forcedsplits_filename", {"fs", "forced_splits_filename", "forced_splits_file", "forced_splits"}},
    {"refit_decay_rate", {}},
    {"cegb_tradeoff", {}},
    {"cegb_penalty_split", {}},
    {"cegb_penalty_feature_lazy", {}},
    {"cegb_penalty_feature_coupled", {}},
    {"path_smooth", {}},
    {"interaction_constraints", {}},
    {"verbosity", {"verbose"}},
    {"input_model", {"model_input", "model_in"}},
    {"output_model", {"model_output", "model_out"}},
    {"saved_feature_importance_type", {}},
    {"snapshot_freq", {"save_period"}},
871
872
873
874
    {"use_quantized_grad", {}},
    {"num_grad_quant_bins", {}},
    {"quant_train_renew_leaf", {}},
    {"stochastic_rounding", {}},
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
    {"linear_tree", {"linear_trees"}},
    {"max_bin", {"max_bins"}},
    {"max_bin_by_feature", {}},
    {"min_data_in_bin", {}},
    {"bin_construct_sample_cnt", {"subsample_for_bin"}},
    {"data_random_seed", {"data_seed"}},
    {"is_enable_sparse", {"is_sparse", "enable_sparse", "sparse"}},
    {"enable_bundle", {"is_enable_bundle", "bundle"}},
    {"use_missing", {}},
    {"zero_as_missing", {}},
    {"feature_pre_filter", {}},
    {"pre_partition", {"is_pre_partition"}},
    {"two_round", {"two_round_loading", "use_two_round_loading"}},
    {"header", {"has_header"}},
    {"label_column", {"label"}},
    {"weight_column", {"weight"}},
    {"group_column", {"group", "group_id", "query_column", "query", "query_id"}},
    {"ignore_column", {"ignore_feature", "blacklist"}},
    {"categorical_feature", {"cat_feature", "categorical_column", "cat_column", "categorical_features"}},
    {"forcedbins_filename", {}},
    {"save_binary", {"is_save_binary", "is_save_binary_file"}},
    {"precise_float_parser", {}},
    {"parser_config_file", {}},
    {"start_iteration_predict", {}},
    {"num_iteration_predict", {}},
    {"predict_raw_score", {"is_predict_raw_score", "predict_rawscore", "raw_score"}},
    {"predict_leaf_index", {"is_predict_leaf_index", "leaf_index"}},
    {"predict_contrib", {"is_predict_contrib", "contrib"}},
    {"predict_disable_shape_check", {}},
    {"pred_early_stop", {}},
    {"pred_early_stop_freq", {}},
    {"pred_early_stop_margin", {}},
    {"output_result", {"predict_result", "prediction_result", "predict_name", "prediction_name", "pred_name", "name_pred"}},
    {"convert_model_language", {}},
    {"convert_model", {"convert_model_file"}},
    {"objective_seed", {}},
    {"num_class", {"num_classes"}},
    {"is_unbalance", {"unbalance", "unbalanced_sets"}},
    {"scale_pos_weight", {}},
    {"sigmoid", {}},
    {"boost_from_average", {}},
    {"reg_sqrt", {}},
    {"alpha", {}},
    {"fair_c", {}},
    {"poisson_max_delta_step", {}},
    {"tweedie_variance_power", {}},
    {"lambdarank_truncation_level", {}},
    {"lambdarank_norm", {}},
    {"label_gain", {}},
924
    {"lambdarank_position_bias_regularization", {}},
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
    {"metric", {"metrics", "metric_types"}},
    {"metric_freq", {"output_freq"}},
    {"is_provide_training_metric", {"training_metric", "is_training_metric", "train_metric"}},
    {"eval_at", {"ndcg_eval_at", "ndcg_at", "map_eval_at", "map_at"}},
    {"multi_error_top_k", {}},
    {"auc_mu_weights", {}},
    {"num_machines", {"num_machine"}},
    {"local_listen_port", {"local_port", "port"}},
    {"time_out", {}},
    {"machine_list_filename", {"machine_list_file", "machine_list", "mlist"}},
    {"machines", {"workers", "nodes"}},
    {"gpu_platform_id", {}},
    {"gpu_device_id", {}},
    {"gpu_use_dp", {}},
    {"num_gpu", {}},
  });
  return map;
942
943
}

944
945
946
947
948
const std::unordered_map<std::string, std::string>& Config::ParameterTypes() {
  static std::unordered_map<std::string, std::string> map({
    {"config", "string"},
    {"objective", "string"},
    {"boosting", "string"},
949
    {"data_sample_strategy", "string"},
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
    {"data", "string"},
    {"valid", "vector<string>"},
    {"num_iterations", "int"},
    {"learning_rate", "double"},
    {"num_leaves", "int"},
    {"tree_learner", "string"},
    {"num_threads", "int"},
    {"device_type", "string"},
    {"seed", "int"},
    {"deterministic", "bool"},
    {"force_col_wise", "bool"},
    {"force_row_wise", "bool"},
    {"histogram_pool_size", "double"},
    {"max_depth", "int"},
    {"min_data_in_leaf", "int"},
    {"min_sum_hessian_in_leaf", "double"},
    {"bagging_fraction", "double"},
    {"pos_bagging_fraction", "double"},
    {"neg_bagging_fraction", "double"},
    {"bagging_freq", "int"},
    {"bagging_seed", "int"},
971
    {"bagging_by_query", "bool"},
972
973
974
975
976
977
    {"feature_fraction", "double"},
    {"feature_fraction_bynode", "double"},
    {"feature_fraction_seed", "int"},
    {"extra_trees", "bool"},
    {"extra_seed", "int"},
    {"early_stopping_round", "int"},
978
    {"early_stopping_min_delta", "double"},
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
    {"first_metric_only", "bool"},
    {"max_delta_step", "double"},
    {"lambda_l1", "double"},
    {"lambda_l2", "double"},
    {"linear_lambda", "double"},
    {"min_gain_to_split", "double"},
    {"drop_rate", "double"},
    {"max_drop", "int"},
    {"skip_drop", "double"},
    {"xgboost_dart_mode", "bool"},
    {"uniform_drop", "bool"},
    {"drop_seed", "int"},
    {"top_rate", "double"},
    {"other_rate", "double"},
    {"min_data_per_group", "int"},
    {"max_cat_threshold", "int"},
    {"cat_l2", "double"},
    {"cat_smooth", "double"},
    {"max_cat_to_onehot", "int"},
    {"top_k", "int"},
    {"monotone_constraints", "vector<int>"},
    {"monotone_constraints_method", "string"},
    {"monotone_penalty", "double"},
    {"feature_contri", "vector<double>"},
    {"forcedsplits_filename", "string"},
    {"refit_decay_rate", "double"},
    {"cegb_tradeoff", "double"},
    {"cegb_penalty_split", "double"},
    {"cegb_penalty_feature_lazy", "vector<double>"},
    {"cegb_penalty_feature_coupled", "vector<double>"},
    {"path_smooth", "double"},
    {"interaction_constraints", "vector<vector<int>>"},
    {"verbosity", "int"},
    {"input_model", "string"},
    {"output_model", "string"},
    {"saved_feature_importance_type", "int"},
    {"snapshot_freq", "int"},
1016
1017
1018
1019
    {"use_quantized_grad", "bool"},
    {"num_grad_quant_bins", "int"},
    {"quant_train_renew_leaf", "bool"},
    {"stochastic_rounding", "bool"},
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
    {"linear_tree", "bool"},
    {"max_bin", "int"},
    {"max_bin_by_feature", "vector<int>"},
    {"min_data_in_bin", "int"},
    {"bin_construct_sample_cnt", "int"},
    {"data_random_seed", "int"},
    {"is_enable_sparse", "bool"},
    {"enable_bundle", "bool"},
    {"use_missing", "bool"},
    {"zero_as_missing", "bool"},
    {"feature_pre_filter", "bool"},
    {"pre_partition", "bool"},
    {"two_round", "bool"},
    {"header", "bool"},
    {"label_column", "string"},
    {"weight_column", "string"},
    {"group_column", "string"},
    {"ignore_column", "vector<int>"},
    {"categorical_feature", "vector<int>"},
    {"forcedbins_filename", "string"},
    {"save_binary", "bool"},
    {"precise_float_parser", "bool"},
    {"parser_config_file", "string"},
    {"start_iteration_predict", "int"},
    {"num_iteration_predict", "int"},
    {"predict_raw_score", "bool"},
    {"predict_leaf_index", "bool"},
    {"predict_contrib", "bool"},
    {"predict_disable_shape_check", "bool"},
    {"pred_early_stop", "bool"},
    {"pred_early_stop_freq", "int"},
    {"pred_early_stop_margin", "double"},
    {"output_result", "string"},
    {"convert_model_language", "string"},
    {"convert_model", "string"},
    {"objective_seed", "int"},
    {"num_class", "int"},
    {"is_unbalance", "bool"},
    {"scale_pos_weight", "double"},
    {"sigmoid", "double"},
    {"boost_from_average", "bool"},
    {"reg_sqrt", "bool"},
    {"alpha", "double"},
    {"fair_c", "double"},
    {"poisson_max_delta_step", "double"},
    {"tweedie_variance_power", "double"},
    {"lambdarank_truncation_level", "int"},
    {"lambdarank_norm", "bool"},
    {"label_gain", "vector<double>"},
1069
    {"lambdarank_position_bias_regularization", "double"},
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
    {"metric", "vector<string>"},
    {"metric_freq", "int"},
    {"is_provide_training_metric", "bool"},
    {"eval_at", "vector<int>"},
    {"multi_error_top_k", "int"},
    {"auc_mu_weights", "vector<double>"},
    {"num_machines", "int"},
    {"local_listen_port", "int"},
    {"time_out", "int"},
    {"machine_list_filename", "string"},
    {"machines", "string"},
    {"gpu_platform_id", "int"},
    {"gpu_device_id", "int"},
    {"gpu_use_dp", "bool"},
    {"num_gpu", "int"},
  });
  return map;
}

1089
}  // namespace LightGBM