add accuracy

This commit is contained in:
tqchen 2014-03-11 13:06:22 -07:00
parent d9ff9fadf6
commit a191863213
3 changed files with 19 additions and 6 deletions

View File

@ -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

View File

@ -159,7 +159,7 @@ namespace xgboost{
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 ];
std::vector<float> &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<int>( evals_[i]->Size() );

View File

@ -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;