From 8ae1d378283708e54be679289a4deb7b5273b390 Mon Sep 17 00:00:00 2001 From: tqchen Date: Sun, 2 Mar 2014 16:42:22 -0800 Subject: [PATCH] auto do reboost --- booster/xgboost_gbmbase.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/booster/xgboost_gbmbase.h b/booster/xgboost_gbmbase.h index 5bee83c3b..e6545dd40 100644 --- a/booster/xgboost_gbmbase.h +++ b/booster/xgboost_gbmbase.h @@ -81,7 +81,11 @@ namespace xgboost{ * \param val value of the parameter */ inline void SetParam( const char *name, const char *val ){ - if( !strcmp("booster_type", name ) ) booster_type = atoi( val ); + if( !strcmp("booster_type", name ) ){ + booster_type = atoi( val ); + // linear boost automatically set do reboost + if( booster_type == 1 ) do_reboost = 1; + } if( !strcmp("num_pbuffer", name ) ) num_pbuffer = atoi( val ); if( !strcmp("do_reboost", name ) ) do_reboost = atoi( val ); if( !strcmp("bst:num_roots", name ) ) num_roots = atoi( val );