1. libsleipnir
  2. sleipnir

Commits

mchikina  committed 543db4c

Added feature eliminations SVMfe.

  • Participants
  • Parent commits b23ae1f
  • Branches sleipnir

Comments (0)

Files changed (6)

File .hgignore

View file
  • Ignore whitespace
 syntax: glob
 MyTools
+workspace
+.settings*
 .deps
 *.Po
 *.cache

File configure.ac

View file
  • Ignore whitespace
                  tools/Data2Svm/Makefile \
                  tools/SVMer/Makefile \
                  tools/SVMperfer/Makefile \
+                 tools/SVMfe/Makefile \
                  tools/SVMmulticlass/Makefile \
                  tools/SVMhierarchy/Makefile \
                  tools/SVMperfing/Makefile \

File gen_tools_am

View file
  • Ignore whitespace
                             OntoShell => ['READLINE'],
                             SVMer => ['SVM_PERF'],
                             SVMperfer => ['SVM_PERF'],
+                            SVMfe => ['SVM_PERF'],
                             SVMmulticlass => ['SVM_MULTICLASS'],
                             SVMhierarchy => ['SVM_HIERARCHY'],
                             SVMperfing => ['SVM_PERF'],

File src/svmperf.h

View file
  • Ignore whitespace
 		}
 	}
 
+
+    size_t ReplaceModel(vector<WORD>& vecW) {
+
+            if (structmodel.svm_model->totwords == vecW.size()) {
+                    for (size_t i; i < vecW.size(); i++) {
+                            structmodel.svm_model->lin_weights[i] = vecW[i].weight;
+                    }
+                    return 0;
+            } else {
+                    cerr << "Could not replace model: Size mismatch" << endl;
+                    return 1;
+            }
+    }
+
+
 	void WriteWeights(ostream& osm) {
 		osm << structmodel.w[0];
 		for (size_t i = 1; i < structmodel.sizePsi + 1; i++)

File tools/Makefile.am

View file
  • Ignore whitespace
 	  Data2Svm \
 	  SVMer \
 	  SVMperfing \
-	  SVMperfer
+	  SVMperfer \
+	SVMfe
 endif
 if WITH_SVM_MULTICLASS_TOOLS
     SVM_MULTICLASS_SUBDIRS = \

File tools/SVMperfer/SVMperfer.cpp

View file
  • Ignore whitespace
     if (vecstrTokens.empty())
       continue;
     if (vecstrTokens.size() != 2) {
-      cerr << "Illegal inout line (" << vecstrTokens.size() << "): "
+      cerr << "Illegal input line (" << vecstrTokens.size() << "): "
         << acBuffer << endl;
       continue;
     }
       numNegatives++;
   }
 
-  cout << numPositives << endl;
-  cout << numNegatives << endl;
+
 
   return vecLabels;
 }