fixed remove bug

This commit is contained in:
tqchen 2014-03-13 13:42:40 -07:00
parent c13126191d
commit d3fe4b26a9

View File

@ -185,10 +185,6 @@ 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<int>( train_->Size() );
for( size_t i = 0; i < evals_.size(); ++i ){
std::vector<float> &preds = this->eval_preds_[ i ];
@ -196,6 +192,10 @@ namespace xgboost{
buffer_offset += static_cast<int>( evals_[i]->Size() );
}
if( action == "remove" ){
base_gbm.DelteBooster(); return;
}
this->GetGradient( preds_, train_->labels, grad_, hess_ );
std::vector<unsigned> root_index;
base_gbm.DoBoost( grad_, hess_, train_->data, root_index );