diff --git a/demo/test/runexp.sh b/demo/test/runexp.sh index ca62140f6..5a5988122 100755 --- a/demo/test/runexp.sh +++ b/demo/test/runexp.sh @@ -24,6 +24,7 @@ python mknfold.py agaricus.txt 1 ../../xgboost mushroom.conf task=dump model_in=m3.model fmap=featmap.txt name_dump=dump.m3.txt ../../xgboost mushroom.conf task=dump model_in=m4.model fmap=featmap.txt name_dump=dump.m4.txt + echo "========m1=======" cat dump.m1.txt @@ -33,10 +34,19 @@ cat dump.m2.txt echo "========m3========" cat dump.m3.txt +# statistics are print into stderr +../../xgboost mushroom.conf model_in=m3.model task=eval 2>eval.m3.txt +cat eval.m3.txt + echo "========m4========" cat dump.m4.txt +../../xgboost mushroom.conf model_in=m4.model task=eval 2>eval.m4.txt +cat eval.m4.txt echo "========full=======" cat dump.full.txt + +../../xgboost mushroom.conf model_in=full.model task=eval 2>eval.full.txt +cat eval.full.txt \ No newline at end of file diff --git a/regression/xgboost_reg.h b/regression/xgboost_reg.h index 683b37b0d..6238a0d44 100644 --- a/regression/xgboost_reg.h +++ b/regression/xgboost_reg.h @@ -159,7 +159,7 @@ namespace xgboost{ int buffer_offset = static_cast( train_->Size() ); for( size_t i = 0; i < evals_.size(); ++i ){ - std::vector &preds = this->eval_preds_[ i ]; + std::vector &preds = this->eval_preds_[ i ]; this->PredictBuffer( preds, *evals_[i], buffer_offset); evaluator_.Eval( fo, evname_[i].c_str(), preds, (*evals_[i]).labels ); buffer_offset += static_cast( evals_[i]->Size() ); diff --git a/regression/xgboost_reg_main.cpp b/regression/xgboost_reg_main.cpp index fe09f94a5..25e5fc848 100644 --- a/regression/xgboost_reg_main.cpp +++ b/regression/xgboost_reg_main.cpp @@ -40,12 +40,13 @@ namespace xgboost{ return 0; } if( task == "interact" ){ - this->TaskInteractive(); - return 0; + this->TaskInteractive(); return 0; } if( task == "dumppath" ){ - this->TaskDumpPath(); - return 0; + this->TaskDumpPath(); return 0; + } + if( task == "eval" ){ + this->TaskEval(); return 0; } if( task == "pred" ){ this->TaskPred(); @@ -160,7 +161,9 @@ namespace xgboost{ printf("\nupdating end, %lu sec in all\n", elapsed ); } } - + inline void TaskEval( void ){ + learner.EvalOneIter( 0 ); + } inline void TaskInteractive( void ){ const time_t start = time( NULL ); unsigned long elapsed = 0;