Definition at line 73 of file SvmProblemBuilder.h. References Clear(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), ILOG_DEBUG, ILOG_ERROR, mModelLabels, mModelLength, mModelNodes, mQuidsIndices, mUsedQuids, and Impala::Core::Table::Table::Size(). Referenced by Impala::Core::Training::TrainDataSrcFeatureTable::MakeSvmProblem(), and Impala::Core::Training::TrainDataSrcFeature::MakeSvmProblem(). 00074 { 00075 // ILOG_INFO("MakeProblem: dumping used quids:"); 00076 // mUsedQuids->Dump(0, 0, 10); 00077 if(mModelLength != mModelLabels.size() || 00078 mModelLength != mModelNodes.size()) 00079 { 00080 ILOG_ERROR("invalid state: model length not consistent"); 00081 Clear(); 00082 return MakeProblem(0); 00083 } 00084 if(mModelLength > mUsedQuids->Size()) 00085 { 00086 ILOG_ERROR_NODE("logic error, quitting"); 00087 Clear(); 00088 return MakeProblem(0); 00089 } 00090 if(mModelLength < mUsedQuids->Size()) 00091 { 00092 ILOG_WARNING_NODE("not all quids of fold/annotation found in features" 00093 <<" model: "<< mModelLength <<", quids: "<< 00094 mUsedQuids->Size()); 00095 } 00096 00097 //ILOG_DEBUG("copying temporary data to problem"); 00098 // copy the collected lables and nodes into the problem 00099 // make sure the order is the same as mUsedQuids (backwards compattible) 00100 svm_problem* problem = Impala::MakeProblem(mModelLength); 00101 int modelIndex = 0; 00102 for(int i=0 ; i<mUsedQuids->Size() ; ++i) 00103 { 00104 Quid q = mUsedQuids->Get1(i); 00105 //ILOG_DEBUG("quid: "<< QuidObj(q)); 00106 int index; 00107 if(mQuidsIndices.Get(q, index)) 00108 { 00109 //ILOG_DEBUG("found index: "<< index); 00110 problem->y[modelIndex] = mModelLabels[index]; 00111 problem->x[modelIndex] = mModelNodes[index]; 00112 ++modelIndex; 00113 } 00114 else 00115 { 00116 //ILOG_DEBUG("Quid "<<QuidObj(q)<<" from fold/annotation not "<< 00117 // "found in features"); 00118 } 00119 } 00120 ILOG_DEBUG("problem built; used quids: "<< mUsedQuids->Size() << 00121 ", problem size: "<< mModelLength); 00122 00123 /* responsability for data is tranfered to caller so we reset the 00124 partial model of this instance */ 00125 Clear(); 00126 return problem; 00127 }
Here is the call graph for this function:
|