From d3fe4b26a919326ba346d1d7defb12de116e49fa Mon Sep 17 00:00:00 2001 From: tqchen Date: Thu, 13 Mar 2014 13:42:40 -0700 Subject: [PATCH] fixed remove bug --- regression/xgboost_reg.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/regression/xgboost_reg.h b/regression/xgboost_reg.h index 2aedf8672..2abe436b7 100644 --- a/regression/xgboost_reg.h +++ b/regression/xgboost_reg.h @@ -185,16 +185,16 @@ namespace xgboost{ inline void UpdateInteract( std::string action ){ this->InteractPredict( preds_, *train_, 0 ); - if( action == "remove" ){ - base_gbm.DelteBooster(); return; - } - int buffer_offset = static_cast( train_->Size() ); for( size_t i = 0; i < evals_.size(); ++i ){ std::vector &preds = this->eval_preds_[ i ]; this->InteractPredict( preds, *evals_[i], buffer_offset ); buffer_offset += static_cast( evals_[i]->Size() ); } + + if( action == "remove" ){ + base_gbm.DelteBooster(); return; + } this->GetGradient( preds_, train_->labels, grad_, hess_ ); std::vector root_index;