/** * @file testClassifier.cpp * @brief main program for classifier evaluation * @author Erik Rodner * @date 2007-10-12 */ #include #include #include #include #include #include #include "vislearning/classifier/classifierbase/FeaturePoolClassifier.h" #include #include #include "core/basics/Config.h" #include #include #undef DEBUG using namespace OBJREC; using namespace NICE; using namespace std; int main( int argc, char **argv ) { std::set_terminate( __gnu_cxx::__verbose_terminate_handler ); Config conf( argc, argv ); string fn = conf.gS( "main", "input", "train.vec" ); int format = conf.gI( "main", "format", 0 ); string outfn = conf.gS( "main", "output", "out.vec" ); LabeledSetVector test; test.read( fn, format ); cout << "fn: " << fn << endl; ofstream fout( outfn.c_str() ); ofstream cn(( outfn + ".cn" ).c_str() ); fout << test.count() << endl; cn << test.count() << endl; fout << test.dimension(); cn << 1; for ( map< int, vector >::iterator iter = test.begin(); iter != test.end(); ++iter ) { for ( int j = 0; j < iter->second.size(); j++ ) { Vector vec = *( iter->second[j] ); cn << endl << iter->first; fout << endl; for ( int i = 0; i < vec.size() - 1; i++ ) { fout << vec[i] << " "; } fout << vec[vec.size()-1]; } } fout.close(); cn.close(); return 0; }