@@ -300,6 +300,11 @@ pub struct TreeBoosterParameters {
300
300
/// default: 1.0
301
301
scale_pos_weight : f32 ,
302
302
303
+ /// Sequence of tree updaters to run, providing a modular way to construct and to modify the trees.
304
+ ///
305
+ /// * default: vec![]
306
+ updater : Vec < TreeUpdater > ,
307
+
303
308
/// This is a parameter of the ‘refresh’ updater plugin. When this flag is true, tree leafs as well as tree nodes'
304
309
/// stats are updated. When it is false, only node stats are updated.
305
310
///
@@ -355,6 +360,7 @@ impl Default for TreeBoosterParameters {
355
360
tree_method : TreeMethod :: default ( ) ,
356
361
sketch_eps : 0.03 ,
357
362
scale_pos_weight : 1.0 ,
363
+ updater : Vec :: new ( ) ,
358
364
refresh_leaf : true ,
359
365
process_type : ProcessType :: default ( ) ,
360
366
grow_policy : GrowPolicy :: default ( ) ,
@@ -394,6 +400,15 @@ impl TreeBoosterParameters {
394
400
v. push ( ( "num_parallel_tree" . to_owned ( ) , self . num_parallel_tree . to_string ( ) ) ) ;
395
401
v. push ( ( "predictor" . to_owned ( ) , self . predictor . to_string ( ) ) ) ;
396
402
403
+ // Don't pass anything to XGBoost if the user didn't specify anything.
404
+ // This allows XGBoost to figure it out on it's own, and suppresses the
405
+ // warning message during training.
406
+ // See: https://github.com/davechallis/rust-xgboost/issues/7
407
+ if self . updater . len ( ) != 0
408
+ {
409
+ v. push ( ( "updater" . to_owned ( ) , self . updater . iter ( ) . map ( |u| u. to_string ( ) ) . collect :: < Vec < String > > ( ) . join ( "," ) ) ) ;
410
+ }
411
+
397
412
v
398
413
}
399
414
}
0 commit comments