Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

void Impala::Core::Training::WriteSvmFile ( const svm_problem p,
const std::string &  filename 
)

Definition at line 80 of file SvmFile.h.

References ILOG_ERROR, ILOG_VAR, svm_node::index, svm_problem::l, svm_node::value, svm_problem::x, and svm_problem::y.

Referenced by Impala::Core::Training::TesterIOHelper::WriteProblem().

00081 {
00082     ILOG_VAR(Impala.Core.Training.SvmFile);
00083     std::ofstream out(filename.c_str());
00084     if(!out.is_open())
00085     {
00086         ILOG_ERROR("could not open file " << filename);
00087         return;
00088     }
00089     for(int i=0 ; i<p->l ; ++i)
00090     {
00091         out << p->y[i];
00092         for(int j=0 ; p->x[i][j].index != -1 ; ++j)
00093             out << " " << p->x[i][j].index << ":" << p->x[i][j].value;
00094         out << "\n";
00095     }
00096     out.close();
00097 }


Generated on Fri Mar 19 11:23:02 2010 for ImpalaSrc by  doxygen 1.5.1