Browse Source

adaptations for uint class numbers in gp-hik-core

Alexander Freytag 9 years ago
parent
commit
61409aae8d

+ 5 - 4
classifier/fpclassifier/gphik/FPCGPHIK.cpp

@@ -69,7 +69,7 @@ ClassificationResult FPCGPHIK::classify ( const NICE::SparseVector * example )
     fthrow(Exception, "Classifier not trained yet -- aborting!" );
   
   NICE::SparseVector scores;
-  int result;
+  uint result;
   
   double uncertainty;
  
@@ -78,11 +78,12 @@ ClassificationResult FPCGPHIK::classify ( const NICE::SparseVector * example )
   if ( scores.size() == 0 ) {
     fthrow(Exception, "Zero scores, something is likely to be wrong here: svec.size() = " << example->size() );
   }
-  int classes = scores.getDim();
+  
+  uint classes = scores.getDim();
   FullVector fvscores(classes);
   
   NICE::SparseVector::const_iterator it;
-  for(int c = 0; c < classes; c++)
+  for( uint c = 0; c < classes; c++ )
   {
     it = scores.find(c);
     if ( it == scores.end() )
@@ -178,7 +179,7 @@ void FPCGPHIK::train ( FeaturePool & fp, Examples & examples )
 }
 
 /** training process */
-void FPCGPHIK::train ( const std::vector< const SparseVector *> & examples, std::map<int, NICE::Vector> & binLabels )
+void FPCGPHIK::train ( const std::vector< const SparseVector *> & examples, std::map< uint, NICE::Vector > & binLabels )
 {
   classifier->train(examples, binLabels);
 }

+ 1 - 1
classifier/fpclassifier/gphik/FPCGPHIK.h

@@ -98,7 +98,7 @@ class FPCGPHIK : public FeaturePoolClassifier
      * @param examples examples to use given in a sparse data structure
      * @param binLabels corresponding binary labels with class no. There is no need here that every examples has only on positive entry in this set (1,-1)
      */
-    void train ( const std::vector< const NICE::SparseVector *> & examples, std::map<int, NICE::Vector> & binLabels );
+    void train ( const std::vector< const NICE::SparseVector *> & examples, std::map< uint, NICE::Vector > & binLabels );
     
     ///////////////////// INTERFACE PERSISTENT /////////////////////
     // interface specific methods for store and restore