KSquare Utilities
SvmWrapper.cpp
Go to the documentation of this file.
1 #include "FirstIncludes.h"
2 
3 /**
4  *@file SvmWrapper.cpp
5  *@brief Provides an interface to the svm.cpp functions.
6  */
7 
8 #include <algorithm>
9 #include <ctype.h>
10 #ifdef WIN32
11 #include "float.h"
12 #endif
13 #include <fstream>
14 #include <iostream>
15 #include <math.h>
16 #include <map>
17 #include <numeric>
18 #ifdef WIN32
19 #include <ostream>
20 #endif
21 #include <set>
22 #include <sstream>
23 #include <stdio.h>
24 #include <string>
25 #include <time.h>
26 #include <vector>
27 #include "MemoryDebug.h"
28 using namespace std;
29 
30 
31 #include "KKBaseTypes.h"
32 #include "OSservices.h"
33 using namespace KKB;
34 
35 
36 #include "SvmWrapper.h"
37 
38 
39 #include "KKMLLTypes.h"
40 #include "svm.h"
41 using namespace KKMLL;
42 
43 
44 
45 #ifdef WIN32
46 #include "float.h"
47 #endif
48 
49 
50 
51 
52 
53 #define Malloc (type,n) (type *)malloc((n)*sizeof(type))
54 
55 
56 
57 
58 void saveData (svm_problem ds,
59  kkint32 begin,
60  kkint32 end,
61  std::string name
62  );
63 
64 
65 
66 template<class T>
67 kkint32 GetMaxIndex (vector<T>& vote,
68  kkint32 voteLength,
69  kkint32& maxIndex2 // second highest indx
70  )
71 {
72  T max=vote[0];
73  kkint32 maxIndex=0;
74 
75  T max2 = 0;
76  maxIndex2 = -1;
77 
78  for (kkint32 i = 1; i < voteLength; i++)
79  {
80  if (vote[i]> max)
81  {
82  max2 = max;
83  maxIndex2 = maxIndex;
84  max = vote[i];
85  maxIndex = i;
86  }
87 
88  else if (maxIndex2 < 0)
89  {
90  max2 = vote[i];
91  maxIndex2 = i;
92  }
93 
94  else if (vote[i] > max2)
95  {
96  max2 = vote[i];
97  maxIndex2 = i;
98  }
99  }
100 
101  return maxIndex;
102 } /* GetMaxIndex */
103 
104 
105 
106 
107 template<class T>
109  kkint32 voteLength,
110  kkint32& maxIndex2 // second highest indx
111  )
112 {
113  T max=vote[0];
114  kkint32 maxIndex=0;
115 
116  T max2 = 0;
117  maxIndex2 = -1;
118 
119  for (kkint32 i = 1; i < voteLength; i++)
120  {
121  if (vote[i]> max)
122  {
123  max2 = max;
124  maxIndex2 = maxIndex;
125  max = vote[i];
126  maxIndex = i;
127  }
128 
129  else if (maxIndex2 < 0)
130  {
131  max2 = vote[i];
132  maxIndex2 = i;
133  }
134 
135  else if (vote[i] > max2)
136  {
137  max2 = vote[i];
138  maxIndex2 = i;
139  }
140  }
141 
142  return maxIndex;
143 } /* GetMaxIndex */
144 
145 
146 
147 
148 
149 
150 
151 bool GreaterThan (kkint32 leftVotes,
152  double leftProb,
153  kkint32 rightVotes,
154  double rightProb
155  )
156 {
157  if (leftVotes < rightVotes)
158  return false;
159 
160  else if (leftVotes > rightVotes)
161  return true;
162 
163  else if (leftProb < rightProb)
164  return false;
165 
166  else if (leftProb > rightProb)
167  return true;
168 
169  else
170  return false;
171 } /* GreaterThan */
172 
173 
174 
175 void GreaterVotes (bool useProbability,
176  kkint32 numClasses,
177  kkint32* votes,
178  double* probabilities,
179  kkint32& pred1Idx,
180  kkint32& pred2Idx
181  )
182 {
183  if (useProbability)
184  {
185  pred1Idx = GetMaxIndex (probabilities, numClasses, pred2Idx);
186  return;
187  }
188 
189  kkint32 max1Votes = votes[0];
190  double max1Prob = probabilities[0];
191  pred1Idx = 0;
192 
193  kkint32 max2Votes = -1;
194  double max2Prob = -1.0f;
195  pred2Idx = -1;
196 
197  for (kkint32 x = 1; x < numClasses; x++)
198  {
199  if (GreaterThan (votes[x], probabilities[x], max1Votes, max1Prob))
200  {
201  max2Votes = max1Votes;
202  max2Prob = max1Prob;
203  pred2Idx = pred1Idx;
204  max1Votes = votes[x];
205  max1Prob = probabilities[x];
206  pred1Idx = x;
207  }
208  else if ((pred2Idx < 0) || GreaterThan (votes[x], probabilities[x], max2Votes, max2Prob))
209  {
210  max2Votes = votes[x];
211  max2Prob = probabilities[x];
212  pred2Idx = x;
213  }
214  }
215 } /* GreaterVotes*/
216 
217 
218 
219 
220 
221 
222 
224  kkint32 begin,
225  kkint32 end,
226  string name
227  )
228 {
229  ofstream out(name.c_str());
230  if(!out.good())
231  {
232  cout << " cannot open " << name << endl;
233  exit(-1);
234  }
235  for(kkint32 i=begin; i<end; i++)
236  {
237  svm_node* temp=ds.x[i];
238  while(temp->index!=-1)
239  {
240  out << temp->value << ",";
241  temp++;
242  }
243  out << ds.y[i] << endl;
244  }
245  out.close();
246 }
247 
248 
249 /**
250  **@brief Will normailize probabilites such that the sum of all equal 1.0 and no one probability will be less than 'minProbability'.
251  *@param[in] numClasses Number of classes represented in array 'probabilities'.
252  *@param[in,out] probabilities Probabilites that are to be adjusted.
253  *@param[in] minProbability Smallest probablity that any one class can have assigned to it.
254  */
256  double* probabilities,
257  double minProbability
258  )
259 {
260  double sumGreaterOrEqualMin = 0.0;
261  kkint32 numLessThanMin = 0;
262 
263  kkint32 x = 0;
264  for (x = 0; x < numClasses; ++x)
265  {
266  if (probabilities[x] < minProbability)
267  ++numLessThanMin;
268  else
269  sumGreaterOrEqualMin += probabilities[x];
270  }
271 
272  double probLessMinTotal = numLessThanMin * minProbability;
273  double probLeftToAllocate = 1.0 - probLessMinTotal;
274 
275  for (x = 0; x < numClasses; ++x)
276  {
277  if (probabilities[x] < minProbability)
278  probabilities[x] = minProbability;
279  else
280  probabilities[x] = (probabilities[x] / sumGreaterOrEqualMin) * probLeftToAllocate;
281  }
282 } /* NormalizeProbabilitiesWithAMinumum */
283 
284 
285 
286 
287 void ComputeProbForVoting (kkint32 numClasses, /**< Number of Classes. */
288  float A, /**< probability parameter */
289  vector<double>& dist, /**< Distances for each binary classifier from decision boundary. */
290  double** crossClassProbTable, /**< Two dimensional array that is 'numClass' by 'numClass'; will receive the probabilities between classes. */
291  kkint32* votes, /**< Array 'numClasses' in length that will receive the number of Votes each class won. */
292  double* probabilities, /**< Array 'numClasses' in length that will receive the computed Probability for Each Class */
293  kkint32 knownClassNum, /**< The Class that we know the example to be. */
294  double confidence, /**< Used for calculating 'compact' probability must exceed this. */
295  double& compact /**< 'knownClassNum' and 'confidence' need to be provided. */
296  )
297 {
298  compact = 0.0;
299 
300  kkint32 i;
301  for (i = 0; i < numClasses; i++)
302  votes[i] = 0;
303 
304  kkint32 distIdx = 0;
305  for (i = 0; i < (numClasses - 1); i++)
306  {
307  for (kkint32 j = i + 1; j < numClasses; j++)
308  {
309  if (dist[distIdx] > 0)
310  votes[i]++;
311  else
312  votes[j]++;
313 
314  crossClassProbTable[i][j] = 0.0;
315  crossClassProbTable[j][i] = 0.0;
316 
317  distIdx++;
318  }
319  }
320 
321  int win1 = -1;
322  int win2 = -1;
323  int win3 = -1;
324  int win4 = -1;
325 
326  int win1Idx = 0;
327  int win2Idx = 0;
328  int win3Idx = 0;
329  int win4Idx = 0;
330 
331  for (i = 0; i < numClasses; ++i)
332  {
333  int zed = votes[i];
334  if (zed >= win4)
335  {
336  win4 = zed;
337  win4Idx = i;
338 
339  if (win4 >= win3)
340  {
341  win4 = win3;
342  win4Idx = win3Idx;
343  win3 = zed;
344  win3Idx = i;
345 
346  if (win3 >= win2)
347  {
348  win3 = win2;
349  win3Idx = win2Idx;
350  win2 = zed;
351  win2Idx = i;
352 
353  if (win2 >= win1)
354  {
355  win2 = win1;
356  win2Idx = win1Idx;
357  win1 = zed;
358  win1Idx = i;
359  }
360  }
361  }
362  }
363  }
364 
365  if (win1 == win2)
366  {
367  if (win1 == win3)
368  {
369  if (win1 == win4)
370  {
371  probabilities[win1Idx] = 0.25;
372  probabilities[win2Idx] = 0.25;
373  probabilities[win3Idx] = 0.25;
374  probabilities[win4Idx] = 0.25;
375  }
376  else
377  {
378  probabilities[win1Idx] = 0.95 / 3.0;
379  probabilities[win2Idx] = 0.95 / 3.0;
380  probabilities[win3Idx] = 0.95 / 3.0;
381  probabilities[win4Idx] = 0.05;
382  }
383  }
384  else
385  {
386  probabilities[win1Idx] = 0.85 / 2.0;
387  probabilities[win2Idx] = 0.85 / 2.0;
388  probabilities[win3Idx] = 0.10;
389  probabilities[win4Idx] = 0.05;
390  }
391  }
392 
393  else
394  {
395  probabilities[win1Idx] = 0.65;
396  if (win2 == win3)
397  {
398  if (win2 == win4)
399  {
400  probabilities[win2Idx] = 0.30 / 3.0;
401  probabilities[win3Idx] = 0.30 / 3.0;
402  probabilities[win4Idx] = 0.30 / 3.0;
403  }
404  else
405  {
406  probabilities[win2Idx] = 0.30 / 2.0;
407  probabilities[win3Idx] = 0.30 / 2.0;
408  probabilities[win4Idx] = 0.05;
409  }
410  }
411 
412  else
413  {
414  probabilities[win2Idx] = 0.20;
415  if (win3 == win4)
416  {
417  probabilities[win3Idx] = 0.15 / 2.0;
418  probabilities[win4Idx] = 0.15 / 2.0;
419  }
420  else
421  {
422  probabilities[win3Idx] = 0.10;
423  probabilities[win4Idx] = 0.05;
424  }
425  }
426  }
427 
428  //NormalizeProbabilitiesWithAMinumum (numClasses, probabilities, 0.001);
429 
430  for (i = 0; i < numClasses; ++i)
431  {
432  crossClassProbTable [win1Idx][i] = probabilities[win1Idx];
433  crossClassProbTable [i][win1Idx] = 1.0 - probabilities[win1Idx];
434  if (i != win1Idx)
435  {
436  crossClassProbTable [win2Idx][i] = probabilities[win2Idx];
437  crossClassProbTable [i][win2Idx] = 1.0 - probabilities[win2Idx];
438  if (i != win2Idx)
439  {
440  crossClassProbTable [win3Idx][i] = probabilities[win3Idx];
441  crossClassProbTable [i][win3Idx] = 1.0 - probabilities[win3Idx];
442  if (i != win3Idx)
443  {
444  crossClassProbTable [win4Idx][i] = probabilities[win4Idx];
445  crossClassProbTable [i][win4Idx] = 1.0 - probabilities[win4Idx];
446  }
447  }
448  }
449  }
450 
451  if ((knownClassNum >= 0) && (knownClassNum < numClasses))
452  {
453  kkint32 maxIndex1 = -1;
454  kkint32 maxIndex2 = -1;
455  maxIndex1 = GetMaxIndex (probabilities, numClasses, maxIndex2);
456 
457  if (probabilities[maxIndex1] >= confidence)
458  {
459  if ((probabilities[knownClassNum] < 1.0f) && (probabilities[knownClassNum] > 0.0f))
460  {
461  compact = -log ((double)probabilities[knownClassNum]);
462  }
463  }
464  }
465 } /* ComputeProbForVoting */
466 
467 
468 
469 
470 
471 
472 void ComputeProb (kkint32 numClasses, // Number of Classes
473  const VectorFloat& probClassPairs, // probability parameter
474  vector<double>& dist, // Distances for each binary classifier from decision boundary.
475  double** crossClassProbTable, // A 'numClass' x 'numClass' matrix; will get the probabilities between classes.
476  kkint32* votes, // votes by class
477  double* probabilities, // Probabilities for Each Class
478  kkint32 knownClassNum // -1 = Don't know the class otherwise the Number of the Class.
479  )
480 {
481  kkint32 i;
482  for (i = 0; i < numClasses; i++)
483  votes[i] = 0;
484 
485  kkint32 distIdx = 0;
486  for (i = 0; i < (numClasses - 1); i++)
487  {
488  for (kkint32 j = i + 1; j < numClasses; j++)
489  {
490  if (dist[distIdx] > 0)
491  votes[i]++;
492  else
493  votes[j]++;
494 
495  double tempProb = (double)(1.0 / (1.0 + exp (-1.0 * probClassPairs[distIdx] * dist[distIdx])));
496  crossClassProbTable[i][j] = tempProb;
497  crossClassProbTable[j][i] = (1.0 - tempProb);
498  distIdx++;
499  }
500  }
501 
502  double totalProb = 0.0;
503  for (i = 0; i < numClasses; i++)
504  {
505  double probThisClass = 1.0;
506  for (kkint32 j = 0; j < numClasses; j++)
507  {
508  if (i != j)
509  probThisClass *= crossClassProbTable [i][j];
510  }
511 
512  probabilities[i] = probThisClass;
513  totalProb += probThisClass;
514  }
515 
516  if (totalProb == 0.0)
517  {
518  // I think this happens because we are using float pfor probTable and double for dist[]
519  // For now we will give each class an equal probability.
520  for (i = 0; i < numClasses; i++)
521  probabilities[i] = (1.0 / double(numClasses));
522  }
523  else
524  {
525  for (i = 0; i < numClasses; i++)
526  probabilities[i] = probabilities[i] / totalProb;
527  }
528 
529  if ((knownClassNum >= 0) && (knownClassNum < numClasses))
530  {
531  kkint32 maxIndex1 = -1;
532  kkint32 maxIndex2 = -1;
533  maxIndex1 = GetMaxIndex (probabilities, numClasses, maxIndex2);
534  }
535  //NormalizeProbabilitiesWithAMinumum (numClasses, probabilities, 0.002);
536 } /* ComputeProb */
537 
538 
539 
540 
541 
542 
543 struct SvmModel233** KKMLL::SvmTrainModel (const struct svm_parameter& param,
544  struct svm_problem& subprob
545  )
546 {
547  struct SvmModel233 **submodel;
548 
549  kkint32 numSVM = param.numSVM;
550  kkint32 sample = (kkint32) (param.sample);
551 
552  //kkint32 numClass=param.numClass;
553  kkint32 sampleSV = param.sampleSV;
554  kkint32 boosting = param.boosting;
555  kkint32 dimSelect = param.dimSelect;
556 
557  LearnType learnType;
558 
559  if ((numSVM == 1) && (sample == 100))
560  learnType= LearnType::NORMAL;
561 
562  else if (dimSelect > 0)
563  learnType = LearnType::SUBSPACE;
564 
565  else if (boosting != 0)
566  learnType=LearnType::BOOSTING;
567 
568  else if(sampleSV!=0)
569  learnType=LearnType::SAMPLESV;
570 
571  else
572  learnType=LearnType::BAGGING;
573 
574  submodel = new SvmModel233* [numSVM];
575  submodel[0] = svm_train (&subprob, &param);
576 
577  return submodel;
578 } /* SvmTrainModel */
579 
580 
581 
582 
583 
584 
585 void KKMLL::SvmPredictClass (SVMparam& svmParam,
586  struct SvmModel233** subModel,
587  const struct svm_node* unknownClassFeatureData,
588  kkint32* votes,
589  double* probabilities,
590  kkint32 knownClass,
591  kkint32& predClass1,
592  kkint32& predClass2,
593  kkint32& predClass1Votes,
594  kkint32& predClass2Votes,
595  double& predClass1Prob,
596  double& predClass2Prob,
597  double& probOfKnownClass,
598  Ivector& winners,
599  double** crossClassProbTable,
600  double& breakTie
601  )
602 {
603  const struct svm_parameter& param = svmParam.Param ();
604 
605  kkint32 NUMCLASS = subModel[0][0].nr_class;
606 
607  kkint32 numBinary = (NUMCLASS * (NUMCLASS - 1)) / 2;
608  Dvector dist (numBinary, 0);
609 
610 
611  svm_predict (subModel[0], unknownClassFeatureData, dist, winners, -1);
612 
613 
614  ComputeProb (NUMCLASS,
615  svmParam.ProbClassPairs (),
616  dist, // Distances for each binary classifier from decision boundary.
617  crossClassProbTable, // Will get Probabilities between classes.
618  votes,
619  probabilities, // Probabilities for Each Class
620  knownClass // -1 = Don't know the class otherwise the Number of the Class.
621  );
622 
624  NUMCLASS,
625  votes,
626  probabilities,
627  predClass1,
628  predClass2
629  );
630  if (predClass1 >= 0)
631  {
632  predClass1Votes = votes[predClass1];
633  predClass1Prob = probabilities[predClass1];
634  }
635 
636  if (predClass2 >= 0)
637  {
638  predClass2Votes = votes[predClass2];
639  predClass2Prob = probabilities[predClass2];
640  }
641 
642  if (knownClass >= 0)
643  probOfKnownClass = probabilities[knownClass];
644 
645  breakTie = (predClass1Prob - predClass2Prob);
646 } /* SvmPredictClass */
647 
648 
649 
650 
651 
652 
654  SvmModel233** submodel,
655  const svm_node* unKnownData,
656  kkint32 desired,
657  double& dist,
658  double& probability,
659  kkint32 excludeSupportVectorIDX
660  )
661 {
662  if (submodel[0]->nr_class != 2)
663  {
664  cerr << endl
665  << endl
666  << "SvmPredictTwoClass *** ERROR ***" << endl
667  << endl
668  << "Number of classes should be equal to two." << endl
669  << endl;
671  exit (-1);
672  }
673 
674  kkint32 v = kkint32 (svm_predictTwoClasses (submodel[0], unKnownData, dist, excludeSupportVectorIDX));
675 
676  probability = (1.0 / (1.0 + exp (-1.0 * param.A * dist)));
677 
678  return v;
679 } /* SvmPredictTwoClass */
680 
681 
682 
683 
684 void KKMLL::SvmPredictRaw (SvmModel233** submodel,
685  const svm_node* unKnownData,
686  double& label,
687  double& dist
688  )
689 {
690  if (submodel[0]->nr_class != 2)
691  {
692  cerr << endl
693  << endl
694  << "SvmPredictTwoClass *** ERROR ***" << endl
695  << endl
696  << "Number of classes should be equal to two." << endl
697  << endl;
699  exit (-1);
700  }
701 
702  dist = 0.0;
703 
704  label = svm_predictTwoClasses (submodel[0], unKnownData, dist, -1);
705 
706  return;
707 } /* SvmPredictRaw */
708 
709 
710 
711 void KKMLL::SvmSaveModel (ostream& o,
712  struct SvmModel233** model
713  )
714 {
715  Svm_Save_Model (o, model[0]);
716 }
717 
718 
719 
720 
721 
722 struct SvmModel233** KKMLL::SvmLoadModel (istream& f,
723  RunLog& log
724  )
725 {
726  SvmModel233** models = new SvmModel233*[1];
727  models[0] = Svm_Load_Model (f, log);
728 
729  if (models[0] == NULL)
730  {
731  delete[] models;
732  models = NULL;
733  }
734 
735  return models;
736 }
737 
738 
739 
740 
741 
742 void KKMLL::SvmDestroyModel (struct SvmModel233** subModel)
743 {
744  svm_destroy_model (subModel[0]);
745 }
std::vector< double > Dvector
Definition: SvmWrapper.h:20
bool GreaterThan(kkint32 leftVotes, double leftProb, kkint32 rightVotes, double rightProb)
Definition: SvmWrapper.cpp:151
void SvmPredictRaw(SvmModel233 **submodel, const svm_node *unKnownData, double &label, double &dist)
Definition: SvmWrapper.cpp:684
kkint32 dimSelect
Definition: svm.h:102
SVM_SelectionMethod
Definition: SVMparam.h:34
__int32 kkint32
Definition: KKBaseTypes.h:88
kkint32 boosting
Definition: svm.h:98
std::vector< kkint32 > Ivector
Definition: SvmWrapper.h:18
kkint32 GetMaxIndex(vector< T > &vote, kkint32 voteLength, kkint32 &maxIndex2)
Definition: SvmWrapper.cpp:67
void SvmSaveModel(ostream &o, struct SvmModel233 **model)
Definition: SvmWrapper.cpp:711
void osWaitForEnter()
LearnType
Definition: SvmWrapper.h:9
void saveData(svm_problem ds, kkint32 begin, kkint32 end, string name)
Definition: SvmWrapper.cpp:223
void ComputeProb(kkint32 numClasses, const VectorFloat &probClassPairs, vector< double > &dist, double **crossClassProbTable, kkint32 *votes, double *probabilities, kkint32 knownClassNum)
Definition: SvmWrapper.cpp:472
kkint32 sampleSV
Definition: svm.h:108
struct SvmModel233 * svm_train(const struct svm_problem *prob, const struct svm_parameter *param)
kkint32 nr_class
Definition: svm.h:138
double svm_predictTwoClasses(const SvmModel233 *model, const svm_node *x, double &dist, kkint32 excludeSupportVectorIDX)
Definition: svm.cpp:4218
struct SvmModel233 * Svm_Load_Model(std::istream &f, RunLog &log)
KKTHread * KKTHreadPtr
kkint16 index
Definition: svm.h:38
struct svm_node ** x
Definition: svm.h:52
std::vector< float > VectorFloat
Definition: KKBaseTypes.h:149
struct SvmModel233 ** SvmTrainModel(const struct svm_parameter &param, struct svm_problem &subprob)
Definition: SvmWrapper.cpp:543
This class encapsulates are the information necessary to build a SVMModel class.
Definition: SVMparam.h:74
void GreaterVotes(bool useProbability, kkint32 numClasses, kkint32 *votes, double *probabilities, kkint32 &pred1Idx, kkint32 &pred2Idx)
Definition: SvmWrapper.cpp:175
kkint32 SvmPredictTwoClass(const struct svm_parameter &param, SvmModel233 **submodel, const svm_node *unKnownData, kkint32 desired, double &dist, double &probability, kkint32 excludeSupportVectorIDX)
kkint32 numSVM
Definition: svm.h:106
void ComputeProbForVoting(kkint32 numClasses, float A, vector< double > &dist, double **crossClassProbTable, kkint32 *votes, double *probabilities, kkint32 knownClassNum, double confidence, double &compact)
Definition: SvmWrapper.cpp:287
SVM_SelectionMethod SelectionMethod() const
Definition: SVMparam.h:169
void NormalizeProbabilitiesWithAMinumum(kkint32 numClasses, double *probabilities, double minProbability)
Will normailize probabilites such that the sum of all equal 1.0 and no one probability will be less t...
Definition: SvmWrapper.cpp:255
void SvmDestroyModel(struct SvmModel233 **subModel)
Definition: SvmWrapper.cpp:742
Used for logging messages.
Definition: RunLog.h:49
void EncodeProblem(const struct svm_paramater &param, struct svm_problem &prob_in, struct svm_problem &prob_out)
struct SvmModel233 ** SvmLoadModel(istream &f, RunLog &log)
Definition: SvmWrapper.cpp:722
void Svm_Save_Model(std::ostream &o, const SvmModel233 *model)
kkint32 GetMaxIndex(T *vote, kkint32 voteLength, kkint32 &maxIndex2)
Definition: SvmWrapper.cpp:108
const svm_parameter & Param() const
Definition: SVMparam.h:159
void svm_destroy_model(struct SvmModel233 *model)
Definition: svm.cpp:4442
void SvmPredictClass(SVMparam &svmParam, struct SvmModel233 **subModel, const struct svm_node *unknownClassFeatureData, kkint32 *votes, double *probabilities, kkint32 knownClass, kkint32 &predClass1, kkint32 &predClass2, kkint32 &predClass1Votes, kkint32 &predClass2Votes, double &predClass1Prob, double &predClass2Prob, double &probOfKnownClass, Ivector &winners, double **crossClassProbTable, double &breakTie)
Definition: SvmWrapper.cpp:585