@@ -47,19 +47,32 @@ type xgLearningFields struct {
4747}
4848
4949type  xgBoosterFields  struct  {
50- 	Objective            string   `json:"objective,omitempty"` 
51- 	Booster              string   `json:"booster,omitempty"` 
52- 	NumClass             uint     `json:"num_class,omitempty"` 
53- 	MaxDepth             uint     `json:"max_depth,omitempty"` 
54- 	Eta                  float32  `json:"eta,omitempty"` 
50+ 	Objective         string   `json:"objective,omitempty"` 
51+ 	EvalMetric        string   `json:"eval_metric,omitempty"` 
52+ 	Booster           string   `json:"booster,omitempty"` 
53+ 	Seed              uint     `json:"seed,omitempty"` 
54+ 	NumClass          uint     `json:"num_class,omitempty"` 
55+ 	Eta               float32  `json:"eta,omitempty"` 
56+ 	Gamma             float32  `json:"gamma,omitempy"` 
57+ 	MaxDepth          uint     `json:"max_depth,omitempty"` 
58+ 	MinChildWeight    uint     `json:"min_child_weight,omitempty"` 
59+ 	Subsample         float32  `json:"subsample,omtiempty"` 
60+ 	ColSampleByTree   float32  `json:"colsample_bytree,omitempty"` 
61+ 	ColSampleByLevel  float32  `json:"colsample_bylevel,omitempty"` 
62+ 	ColSampleByNode   float32  `json:"colsample_bynode,omitempty"` 
63+ 	// `Lambda` is reversed in python, so we use alias reg_lambda. 
64+ 	Lambda  float32  `json:"reg_lambda,omitempty"` 
65+ 	// We use alias `reg_alpha` to keep align with `reg_lambda`。 
66+ 	Alpha                float32  `json:"reg_alpha,omitempty"` 
5567	TreeMethod           string   `json:"tree_method,omitempty"` 
56- 	EvalMetric           string    `json:"eval_metric ,omitempty"` 
57- 	Subsample             float32  `json:"subsample ,omitempty"` 
58- 	ColSampleByTree      float32   `json:"colsample_bytree ,omitempty"` 
59- 	ColSampleByLevel     float32   `json:"colsample_bylevel ,omitempty"` 
68+ 	SketchEps             float32  `json:"sketch_eps ,omitempty"` 
69+ 	ScalePosWeight       float32  `json:"scale_pos_weight ,omitempty"` 
70+ 	GrowPolicy            string    `json:"grow_policy ,omitempty"` 
71+ 	MaxLeaves             uint      `json:"max_leaves ,omitempty"` 
6072	MaxBin               uint     `json:"max_bin,omitempty"` 
61- 	ConvergenceCriteria  string   `json:"convergence_criteria,omitempty"` 
62- 	Verbosity            uint     `json:"verbosity,omitempty"` 
73+ 	NumParallelTree      uint     `json:"num_parallel_tree,omitempty"` 
74+ 	ConvergenceCriteria  string   `json:"convergence_criteria,omitempty"`  // auto_train config 
75+ 	Verbosity            uint     `json:"verbosity,omitempty"`             // auto_train config 
6376}
6477
6578type  xgColumnFields  struct  {
@@ -248,16 +261,27 @@ func sListPartial(key string, ptrFn func(*xgboostFiller) *[]string) func(*map[st
248261var  xgbTrainAttrSetterMap  =  map [string ]func (* map [string ][]string , * xgboostFiller ) error {
249262	// booster params 
250263	"train.objective" :            strPartial ("train.objective" , func (r  * xgboostFiller ) * string  { return  & (r .Objective ) }),
264+ 	"train.eval_metric" :          strPartial ("train.eval_metric" , func (r  * xgboostFiller ) * string  { return  & (r .EvalMetric ) }),
251265	"train.booster" :              strPartial ("train.booster" , func (r  * xgboostFiller ) * string  { return  & (r .Booster ) }),
252- 	"train.max_depth " :            uIntPartial ("train.max_depth " , func (r  * xgboostFiller ) * uint  { return  & (r .MaxDepth ) }),
266+ 	"train.seed " :                  uIntPartial ("train.seed " , func (r  * xgboostFiller ) * uint  { return  & (r .Seed ) }),
253267	"train.num_class" :            uIntPartial ("train.num_class" , func (r  * xgboostFiller ) * uint  { return  & (r .NumClass ) }),
254268	"train.eta" :                  fp32Partial ("train.eta" , func (r  * xgboostFiller ) * float32  { return  & (r .Eta ) }),
255- 	"train.tree_method" :          strPartial ("train.tree_method" , func (r  * xgboostFiller ) * string  { return  & (r .TreeMethod ) }),
256- 	"train.eval_metric" :          strPartial ("train.eval_metric" , func (r  * xgboostFiller ) * string  { return  & (r .EvalMetric ) }),
269+ 	"train.gamma" :                fp32Partial ("train.gamma" , func (r  * xgboostFiller ) * float32  { return  & (r .Gamma ) }),
270+ 	"train.max_depth" :            uIntPartial ("train.max_depth" , func (r  * xgboostFiller ) * uint  { return  & (r .MaxDepth ) }),
271+ 	"train.min_child_weight" :     uIntPartial ("train.min_child_weight" , func (r  * xgboostFiller ) * uint  { return  & (r .MinChildWeight ) }),
257272	"train.subsample" :            fp32Partial ("train.subsample" , func (r  * xgboostFiller ) * float32  { return  & (r .Subsample ) }),
258273	"train.colsample_bytree" :     fp32Partial ("train.colsample_bytree" , func (r  * xgboostFiller ) * float32  { return  & (r .ColSampleByTree ) }),
259274	"train.colsample_bylevel" :    fp32Partial ("train.colsample_bylevel" , func (r  * xgboostFiller ) * float32  { return  & (r .ColSampleByLevel ) }),
275+ 	"train.colsample_bynode" :     fp32Partial ("train.colsample_bynode" , func (r  * xgboostFiller ) * float32  { return  & (r .ColSampleByNode ) }),
276+ 	"train.lambda" :               fp32Partial ("train.lambda" , func (r  * xgboostFiller ) * float32  { return  & (r .Lambda ) }),
277+ 	"train.alpha" :                fp32Partial ("train.alpha" , func (r  * xgboostFiller ) * float32  { return  & (r .Alpha ) }),
278+ 	"train.tree_method" :          strPartial ("train.tree_method" , func (r  * xgboostFiller ) * string  { return  & (r .TreeMethod ) }),
279+ 	"train.sketch_eps" :           fp32Partial ("train.sketch_eps" , func (r  * xgboostFiller ) * float32  { return  & (r .SketchEps ) }),
280+ 	"train.scale_pos_weight" :     fp32Partial ("train.scale_pos_weight" , func (r  * xgboostFiller ) * float32  { return  & (r .ScalePosWeight ) }),
281+ 	"train.grow_policy" :          strPartial ("train.grow_policy" , func (r  * xgboostFiller ) * string  { return  & (r .GrowPolicy ) }),
282+ 	"train.max_leaves" :           uIntPartial ("train.max_leaves" , func (r  * xgboostFiller ) * uint  { return  & (r .MaxLeaves ) }),
260283	"train.max_bin" :              uIntPartial ("train.max_bin" , func (r  * xgboostFiller ) * uint  { return  & (r .MaxBin ) }),
284+ 	"train.num_parallel_tree" :    uIntPartial ("train.num_parallel_tree" , func (r  * xgboostFiller ) * uint  { return  & (r .NumParallelTree ) }),
261285	"train.convergence_criteria" : strPartial ("train.convergence_criteria" , func (r  * xgboostFiller ) * string  { return  & (r .ConvergenceCriteria ) }),
262286	"train.verbosity" :            uIntPartial ("train.verbosity" , func (r  * xgboostFiller ) * uint  { return  & (r .Verbosity ) }),
263287	// xgboost train controllers 
0 commit comments