From c7869a78559eba5e27e66b5a419cd382ae5b54f2 Mon Sep 17 00:00:00 2001 From: tqchen Date: Tue, 25 Mar 2014 17:17:00 -0700 Subject: [PATCH] small fix --- demo/binary_classification/runexp.sh | 9 +++++---- regression/xgboost_reg_main.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/demo/binary_classification/runexp.sh b/demo/binary_classification/runexp.sh index bd4354104..68c3e6fb9 100755 --- a/demo/binary_classification/runexp.sh +++ b/demo/binary_classification/runexp.sh @@ -6,9 +6,10 @@ python mknfold.py agaricus.txt 1 # training and output the models ../../xgboost mushroom.conf # output prediction task=pred -../../xgboost mushroom.conf task=pred model_in=0003.model -# print the boosters of 00003.model in dump.raw.txt -../../xgboost mushroom.conf task=dump model_in=0003.model name_dump=dump.raw.txt +../../xgboost mushroom.conf task=pred model_in=0002.model +# print the boosters of 00002.model in dump.raw.txt +../../xgboost mushroom.conf task=dump model_in=0002.model name_dump=dump.raw.txt # use the feature map in printing for better visualization -../../xgboost mushroom.conf task=dump model_in=0003.model fmap=featmap.txt name_dump=dump.nice.txt +../../xgboost mushroom.conf task=dump model_in=0002.model fmap=featmap.txt name_dump=dump.nice.txt cat dump.nice.txt + diff --git a/regression/xgboost_reg_main.cpp b/regression/xgboost_reg_main.cpp index 4e590b05d..9d43c22fb 100644 --- a/regression/xgboost_reg_main.cpp +++ b/regression/xgboost_reg_main.cpp @@ -155,7 +155,7 @@ namespace xgboost{ // always save final round if( save_period == 0 || num_round % save_period != 0 ){ if( model_out == "NULL" ){ - this->SaveModel( num_round ); + this->SaveModel( num_round - 1 ); }else{ this->SaveModel( model_out.c_str() ); }