Bjoern Froehlich 13 rokov pred
rodič
commit
1fd7024938

+ 76 - 76
classifier/genericClassifierSelection.h

@@ -51,92 +51,92 @@ namespace OBJREC {
 
 class GenericClassifierSelection
 {
-    public:
+  public:
 
-		static VecClassifier *selectVecClassifier ( const NICE::Config *conf, std::string classifier_type )
-		{
-			 std::vector<std::string> submatches;
-			 VecClassifier *classifier = NULL;
+    static VecClassifier *selectVecClassifier ( const NICE::Config *conf, std::string classifier_type )
+    {
+      std::vector<std::string> submatches;
+      VecClassifier *classifier = NULL;
 
-			 if ( classifier_type == "amit" ) {
-				  classifier = new VCAmitSVM ( conf );
+      if ( classifier_type == "amit" ) {
+        classifier = new VCAmitSVM ( conf );
 
-			 } else if ( classifier_type == "nn" ) {
-				  classifier = new VCNearestNeighbour( conf, new NICE::EuclidianDistance<double>() );
-#ifdef NICE_USELIB_ICE 
-			 } else if ( classifier_type == "gauss" ) {
-				  classifier = new VCSimpleGaussian( conf );
+      } else if ( classifier_type == "nn" ) {
+        classifier = new VCNearestNeighbour ( conf, new NICE::EuclidianDistance<double>() );
+#ifdef NICE_USELIB_ICE
+      } else if ( classifier_type == "gauss" ) {
+        classifier = new VCSimpleGaussian ( conf );
 #endif
-			 } else if ( classifier_type == "random_forest" ) {
-				  FeaturePoolClassifier *fpc = new FPCRandomForests ( conf, "RandomForest" );
-				  classifier = new VCFeaturePool ( conf, fpc );
-				
-			 } else if ( classifier_type == "sparse_logistic_regression" ) {
-				 FeaturePoolClassifier *fpc = new FPCSMLR ( conf, "SparseLogisticRegression" );
-				 classifier = new VCFeaturePool ( conf, fpc );
-				  
-			 } else if ( classifier_type == "boost" ) {
-				  FeaturePoolClassifier *fpc = new FPCBoosting ( conf, "Boost" );
-				  classifier = new VCFeaturePool ( conf, fpc );
-			 
-				 } else if ( classifier_type == "decision_tree" ) {
-				  FeaturePoolClassifier *fpc = new FPCDecisionTree ( conf, "DecisionTree" );
-				  classifier = new VCFeaturePool ( conf, fpc );
+      } else if ( classifier_type == "random_forest" ) {
+        FeaturePoolClassifier *fpc = new FPCRandomForests ( conf, "RandomForest" );
+        classifier = new VCFeaturePool ( conf, fpc );
+
+      } else if ( classifier_type == "sparse_logistic_regression" ) {
+        FeaturePoolClassifier *fpc = new FPCSMLR ( conf, "SparseLogisticRegression" );
+        classifier = new VCFeaturePool ( conf, fpc );
+
+      } else if ( classifier_type == "boost" ) {
+        FeaturePoolClassifier *fpc = new FPCBoosting ( conf, "Boost" );
+        classifier = new VCFeaturePool ( conf, fpc );
+
+      } else if ( classifier_type == "decision_tree" ) {
+        FeaturePoolClassifier *fpc = new FPCDecisionTree ( conf, "DecisionTree" );
+        classifier = new VCFeaturePool ( conf, fpc );
 #ifdef NICE_USELIB_ICE
-			 } else if ( (classifier_type == "cross_generalization") || (classifier_type == "bart") ) {
-				  classifier = new VCCrossGeneralization ( conf );
+      } else if ( ( classifier_type == "cross_generalization" ) || ( classifier_type == "bart" ) ) {
+        classifier = new VCCrossGeneralization ( conf );
 #endif
 #ifdef NICE_USELIB_SVMLIGHT
-			 } else if ( (classifier_type == "svmlight") || (classifier_type == "svm") ) {
-				  classifier = new VCSVMLight ( conf );
-			 } else if ( (classifier_type == "svm_onevsone") ) {
-				  classifier = new VCOneVsOne ( conf, new VCSVMLight(conf) );
-			 } else if ( (classifier_type == "svm_onevsall") ) {
-				  classifier = new VCOneVsAll ( conf, new VCSVMLight(conf) );
-			 } else if ( (classifier_type == "svmlight_kernel")) {
-				  classifier = new KCSVMLight ( conf, new KernelStd() );
-			 } else if ( (classifier_type == "svm_one_class")) {
-				  classifier = new VCSVMOneClass( conf, "VCSVMLight" );
+      } else if ( ( classifier_type == "svmlight" ) || ( classifier_type == "svm" ) ) {
+        classifier = new VCSVMLight ( conf );
+      } else if ( ( classifier_type == "svm_onevsone" ) ) {
+        classifier = new VCOneVsOne ( conf, new VCSVMLight ( conf ) );
+      } else if ( ( classifier_type == "svm_onevsall" ) ) {
+        classifier = new VCOneVsAll ( conf, new VCSVMLight ( conf ) );
+      } else if ( ( classifier_type == "svmlight_kernel" ) ) {
+        classifier = new KCSVMLight ( conf, new KernelStd() );
+      } else if ( ( classifier_type == "svm_one_class" ) ) {
+        classifier = new VCSVMOneClass ( conf, "VCSVMLight" );
 #endif
 #ifdef NICE_USELIB_NICEDTSVM
-			 // this classifier requires nice-dtsvm, which is an optional
-			 // nice sub-library
-			 } else if ( classifier_type == "treebased" ) {
-				 classifier = new VCTreeBasedClassifier ( conf );
+        // this classifier requires nice-dtsvm, which is an optional
+        // nice sub-library
+      } else if ( classifier_type == "treebased" ) {
+        classifier = new VCTreeBasedClassifier ( conf );
 #endif
-			 } else if ( (classifier_type == "dtgp") ) {
-				  classifier = new VCDTSVM ( conf );
-			 } else if ( (classifier_type == "minimum_enclosing_ball")) {
-				  string kernel_type = conf->gS("Kernel", "kernel_function", "rbf" );
-				  classifier = new KCMinimumEnclosingBall ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
-			 } else if ( (classifier_type == "gp_one_class")) {
-				  string kernel_type = conf->gS("Kernel", "kernel_function", "rbf" );
-				  classifier = new KCGPOneClass ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
-			 } else if ( (classifier_type == "gp_regression_rbf")) {
-				  string kernel_type = conf->gS("Kernel", "kernel_function", "rbf" );
-				  classifier = new KCGPRegression ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
-			 } else if ( (classifier_type == "gp_laplace_rbf")) {
-				  string kernel_type = conf->gS("Kernel", "kernel_function", "rbf" );
-				  classifier = new KCGPLaplace ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
-			 } else if ( (classifier_type == "gp_regression_rbf_onevsall" ) ) {
-				  string kernel_type = conf->gS("Kernel", "kernel_function", "rbf" );
-				  classifier = new KCGPRegOneVsAll ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
-			 } else if ( (classifier_type == "gp_laplace_rbf_onevsall" ) ) {
-				  string kernel_type = conf->gS("Kernel", "kernel_function", "rbf" );
-				  classifier = new KCGPLaplaceOneVsAll ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
-			 } else if ( StringTools::regexMatch ( classifier_type, "^one_vs_one\\(([^\\)]+)\\)$", submatches ) && (submatches.size() == 2)) {
-				  classifier = new VCOneVsOne ( conf, selectVecClassifier( conf, submatches[1] ) );
-			 } else if ( StringTools::regexMatch ( classifier_type, "^one_vs_all\\(([^\\)]+)\\)$", submatches ) && (submatches.size() == 2)) {
-				  classifier = new VCOneVsAll ( conf, selectVecClassifier( conf, submatches[1] ) );
-			 } else if ( StringTools::regexMatch ( classifier_type, "^random_forest\\(([^\\)]+)\\)$", submatches ) && (submatches.size() == 2)) {
-				  classifier = new VCPreRandomForest ( conf, "VCPreRandomForest", selectVecClassifier(conf, submatches[1] ) );
-			 } else {
-				  fthrow ( Exception, "Classifier type " << classifier_type << " not (yet) supported." << endl <<
-				  			"(genericClassifierSelection.h contains a list of classifiers to choose from)");
-			 }
-
-			 return classifier;
-		}
+      } else if ( ( classifier_type == "dtgp" ) ) {
+        classifier = new VCDTSVM ( conf );
+      } else if ( ( classifier_type == "minimum_enclosing_ball" ) ) {
+        string kernel_type = conf->gS ( "Kernel", "kernel_function", "rbf" );
+        classifier = new KCMinimumEnclosingBall ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
+      } else if ( ( classifier_type == "gp_one_class" ) ) {
+        string kernel_type = conf->gS ( "Kernel", "kernel_function", "rbf" );
+        classifier = new KCGPOneClass ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
+      } else if ( ( classifier_type == "gp_regression_rbf" ) ) {
+        string kernel_type = conf->gS ( "Kernel", "kernel_function", "rbf" );
+        classifier = new KCGPRegression ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
+      } else if ( ( classifier_type == "gp_laplace_rbf" ) ) {
+        string kernel_type = conf->gS ( "Kernel", "kernel_function", "rbf" );
+        classifier = new KCGPLaplace ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
+      } else if ( ( classifier_type == "gp_regression_rbf_onevsall" ) ) {
+        string kernel_type = conf->gS ( "Kernel", "kernel_function", "rbf" );
+        classifier = new KCGPRegOneVsAll ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
+      } else if ( ( classifier_type == "gp_laplace_rbf_onevsall" ) ) {
+        string kernel_type = conf->gS ( "Kernel", "kernel_function", "rbf" );
+        classifier = new KCGPLaplaceOneVsAll ( conf, GenericKernelSelection::selectKernel ( conf, kernel_type ) );
+      } else if ( StringTools::regexMatch ( classifier_type, "^one_vs_one\\(([^\\)]+)\\)$", submatches ) && ( submatches.size() == 2 ) ) {
+        classifier = new VCOneVsOne ( conf, selectVecClassifier ( conf, submatches[1] ) );
+      } else if ( StringTools::regexMatch ( classifier_type, "^one_vs_all\\(([^\\)]+)\\)$", submatches ) && ( submatches.size() == 2 ) ) {
+        classifier = new VCOneVsAll ( conf, selectVecClassifier ( conf, submatches[1] ) );
+      } else if ( StringTools::regexMatch ( classifier_type, "^random_forest\\(([^\\)]+)\\)$", submatches ) && ( submatches.size() == 2 ) ) {
+        classifier = new VCPreRandomForest ( conf, "VCPreRandomForest", selectVecClassifier ( conf, submatches[1] ) );
+      } else {
+        fthrow ( Exception, "Classifier type " << classifier_type << " not (yet) supported." << endl <<
+                 "(genericClassifierSelection.h contains a list of classifiers to choose from)" );
+      }
+
+      return classifier;
+    }
 
 };
 

+ 156 - 156
classifier/vclassifier/VCDTSVM.cpp

@@ -11,78 +11,78 @@ using namespace OBJREC;
 using namespace std;
 using namespace NICE;
 
-VCDTSVM::VCDTSVM ( const Config *_conf, const string & section ) 
+VCDTSVM::VCDTSVM ( const Config *_conf, const string & section )
     : VecClassifier ( _conf )
 {
-    binary = _conf->gS(section, "binary", "./tdsvm");
-    configtrain = _conf->gS(section, "configtrain", "configtrain.txt");
-    configtest = _conf->gS(section, "configtest", "configtest.txt");
-    trainfile  = _conf->gS(section, "traindst", "train.txt");
-    testfile  = _conf->gS(section, "testdst", "test.txt");
+  binary = _conf->gS ( section, "binary", "./tdsvm" );
+  configtrain = _conf->gS ( section, "configtrain", "configtrain.txt" );
+  configtest = _conf->gS ( section, "configtest", "configtest.txt" );
+  trainfile  = _conf->gS ( section, "traindst", "train.txt" );
+  testfile  = _conf->gS ( section, "testdst", "test.txt" );
 
 #ifndef WRITE
-    counter = new vector<int>(1,0);
-    if(results.size() == 0)
+  counter = new vector<int> ( 1, 0 );
+  if ( results.size() == 0 )
+  {
+
+    ifstream fin ( "results.txt" );
+
+
+    const int bufsize = 1024 * 1024;
+    char *buf = new char[bufsize];
+    std::string buf_s;
+    while ( !fin.eof() )
     {
+      int bc;
+      vector<string> elements;
+      fin >> bc;
+      fin.get ( buf, bufsize );
+      buf_s = buf;
+
+      if ( buf_s.size() <= 0 )
+        break;
+
+      StringTools::split ( buf_s, ' ', elements );
 
-	    ifstream fin("results.txt");
-		
-
-	    const int bufsize = 1024*1024;
-	    char *buf = new char[bufsize];
-	    std::string buf_s;	
-	    while(!fin.eof())
-	    {
-		    int bc;
-		    vector<string> elements;
-		    fin >> bc;
-		    fin.get ( buf, bufsize );
-		    buf_s = buf;
-	
-		    if ( buf_s.size() <= 0 ) 
-			    break;
-	
-		    StringTools::split ( buf_s, ' ', elements );
-	
-		    if ( elements.size() <= 1 )
-			    break;
-	
-		    vector<double> tmp;
-	
-		    size_t l = 0;
-			
-			// skip first element because of white space
-		    for ( vector<string>::const_iterator i  = elements.begin()+1; i != elements.end(); i++, l++ )
-		    {
-			    double val = atof ( i->c_str() );
-			    tmp.push_back(val);
-		    }
-		    results.push_back(tmp);
-		    labels.push_back(bc);
-	    }
-
-	    fin.close();
-
-	    (*counter)[0] = 0;
-	    //counter = 0;
+      if ( elements.size() <= 1 )
+        break;
+
+      vector<double> tmp;
+
+      size_t l = 0;
+
+      // skip first element because of white space
+      for ( vector<string>::const_iterator i  = elements.begin() + 1; i != elements.end(); i++, l++ )
+      {
+        double val = atof ( i->c_str() );
+        tmp.push_back ( val );
+      }
+      results.push_back ( tmp );
+      labels.push_back ( bc );
     }
+
+    fin.close();
+
+    ( *counter ) [0] = 0;
+    //counter = 0;
+  }
 #endif
 }
 
-VCDTSVM::VCDTSVM ( const VCDTSVM & classifier ) : VecClassifier() 
+VCDTSVM::VCDTSVM ( const VCDTSVM & classifier ) : VecClassifier()
 {
-	binary = classifier.binary;
-	configtrain = classifier.configtrain;
-	configtest = classifier.configtest;
-	trainfile = classifier.trainfile;
-	testfile = classifier.testfile;
+  binary = classifier.binary;
+  configtrain = classifier.configtrain;
+  configtest = classifier.configtest;
+  trainfile = classifier.trainfile;
+  testfile = classifier.testfile;
 }
 
 
 VCDTSVM::~VCDTSVM()
 {
-	int c2 = (*counter)[0];
-	cout << "c2: " << c2 << " matsize " << results.size() << endl;
+  int c2 = ( *counter ) [0];
+  cout << "c2: " << c2 << " matsize " << results.size() << endl;
 }
 
 ClassificationResult VCDTSVM::classify ( const NICE::Vector & x ) const
@@ -90,105 +90,105 @@ ClassificationResult VCDTSVM::classify ( const NICE::Vector & x ) const
 
 
 #ifdef WRITE
-	ofstream fout( testfile.c_str(), ios::app );
-	fout << 0 << " ";
-	int i;
-	for(i = 0; i < x.size()-1; i++)
-	{
-		fout << i+1 << ":" << x[i] << " ";
-	}
-	i++;
-	fout << i+1 << ":" << x[i] << endl;
-	fout.close();
-	
-	
-	FullVector scores(10);
-
-	//scores.read("scores");
-	double bval = scores[0];
-
-	int bclass = 0;
-	for(i = 1; i < scores.size(); i++)
-	{
-		if(bval < scores[i])
-		{
-			bval = scores[i];
-			bclass = i;
-		}
-	}
-	return ClassificationResult (bclass, scores);
+  ofstream fout ( testfile.c_str(), ios::app );
+  fout << 0 << " ";
+  int i;
+  for ( i = 0; i < x.size() - 1; i++ )
+  {
+    fout << i + 1 << ":" << x[i] << " ";
+  }
+  i++;
+  fout << i + 1 << ":" << x[i] << endl;
+  fout.close();
+
+
+  FullVector scores ( 10 );
+
+  //scores.read("scores");
+  double bval = scores[0];
+
+  int bclass = 0;
+  for ( i = 1; i < scores.size(); i++ )
+  {
+    if ( bval < scores[i] )
+    {
+      bval = scores[i];
+      bclass = i;
+    }
+  }
+  return ClassificationResult ( bclass, scores );
 #endif
-	
+
 #ifndef WRITE
-	int c2 = (*counter)[0];
-	(*counter)[0]++;
-	FullVector tmp(results[c2].size());
-	for(int i = 0; i < results[c2].size(); i++)
-	{
-		tmp[i] = results[c2][i];
-	}
-	return ClassificationResult (labels[c2], tmp);	
+  int c2 = ( *counter ) [0];
+  ( *counter ) [0]++;
+  FullVector tmp ( results[c2].size() );
+  for ( int i = 0; i < results[c2].size(); i++ )
+  {
+    tmp[i] = results[c2][i];
+  }
+  return ClassificationResult ( labels[c2], tmp );
 #endif
 
-#if 0	
-	const int buffersize = 65536;
-	char *buffer = new char [buffersize];
-	
-	string call = binary +" "+configtest;
-	
-	FILE *f = popen ( call.c_str(), "r" );
-	
-	if ( f == NULL )
-	{
-		fprintf (stderr, "VCDTSVM::classify: FATAL ERROR, unable to run the implementation of DTSVM\n");
-		exit(-1);
-	}
-	
-	while ( ! feof(f) ) 
-	{
-		if ( fgets ( buffer, buffersize, f ) <= 0 )
-		{
-			break;
-		} else 
-		{
-			//fprintf (stderr, "VCDTSVM::classify: [INFO] %s", buffer );
-		}
-	}
-	pclose(f);
+#if 0
+  const int buffersize = 65536;
+  char *buffer = new char [buffersize];
+
+  string call = binary + " " + configtest;
+
+  FILE *f = popen ( call.c_str(), "r" );
+
+  if ( f == NULL )
+  {
+    fprintf ( stderr, "VCDTSVM::classify: FATAL ERROR, unable to run the implementation of DTSVM\n" );
+    exit ( -1 );
+  }
+
+  while ( ! feof ( f ) )
+  {
+    if ( fgets ( buffer, buffersize, f ) <= 0 )
+    {
+      break;
+    } else
+    {
+      //fprintf (stderr, "VCDTSVM::classify: [INFO] %s", buffer );
+    }
+  }
+  pclose ( f );
 #endif
 }
 
 void VCDTSVM::teach ( const LabeledSetVector & _teachSet )
 {
-    	maxClassNo = _teachSet.getMaxClassno();
-    	//TODO: LabeledSet rausschreiben und classifier anwerfen
+  maxClassNo = _teachSet.getMaxClassno();
+  //TODO: LabeledSet rausschreiben und classifier anwerfen
 #ifdef WRITE
-    	_teachSet.write(trainfile, LabeledSetVector::FILEFORMAT_INDEX);
-    /*
-    	string call = binary +" "+configtrain;
-    
-    	const int buffersize = 65536;
-	char *buffer = new char [buffersize];
-	
-	FILE *f = popen ( call.c_str(), "r" );
-	
-	if ( f == NULL )
-	{
-		fprintf (stderr, "VCDTSVM::teach: FATAL ERROR, unable to run the implementation of DTSVM\n");
-		exit(-1);
-	}
-	
-	while ( ! feof(f) ) 
-	{
-		if ( fgets ( buffer, buffersize, f ) <= 0 )
-		{
-			break;
-		} else 
-		{
-			fprintf (stderr, "VCDTSVM::teach: [INFO] %s", buffer );
-		}
-	}
-	pclose(f);*/
+  _teachSet.write ( trainfile, LabeledSetVector::FILEFORMAT_INDEX );
+  /*
+   string call = binary +" "+configtrain;
+
+   const int buffersize = 65536;
+  char *buffer = new char [buffersize];
+
+  FILE *f = popen ( call.c_str(), "r" );
+
+  if ( f == NULL )
+  {
+  fprintf (stderr, "VCDTSVM::teach: FATAL ERROR, unable to run the implementation of DTSVM\n");
+  exit(-1);
+  }
+
+  while ( ! feof(f) )
+  {
+  if ( fgets ( buffer, buffersize, f ) <= 0 )
+  {
+  break;
+  } else
+  {
+  fprintf (stderr, "VCDTSVM::teach: [INFO] %s", buffer );
+  }
+  }
+  pclose(f);*/
 #endif
 }
 
@@ -197,35 +197,35 @@ void VCDTSVM::finishTeaching()
 }
 
 /** clone this object */
-VCDTSVM *VCDTSVM::clone(void) const
+VCDTSVM *VCDTSVM::clone ( void ) const
 {
-	VCDTSVM *classifier = new VCDTSVM( *this );
-	return classifier;
+  VCDTSVM *classifier = new VCDTSVM ( *this );
+  return classifier;
 }
 
 void VCDTSVM::clear ()
 {
-    //TODO wieder freigeben
+  //TODO wieder freigeben
 }
 
-void VCDTSVM::read (const string& s, int format)
+void VCDTSVM::read ( const string& s, int format )
 {
-    //TODO: Zielverzeichnis eventuell
+  //TODO: Zielverzeichnis eventuell
 }
 
-void VCDTSVM::save (const string& s, int format) const
+void VCDTSVM::save ( const string& s, int format ) const
 {
-    //TODO: Zielverzeichnis eventuell
+  //TODO: Zielverzeichnis eventuell
 }
 
 
 void VCDTSVM::store ( std::ostream & os, int format ) const
 {
-    fprintf (stderr, "VCDTSVM: unable to write to stream! please use read()\n");
+  fprintf ( stderr, "VCDTSVM: unable to write to stream! please use read()\n" );
 }
 
 void VCDTSVM::restore ( std::istream & is, int format )
 {
-    fprintf (stderr, "VCDTSVM: unable to read from stream! please use save()\n");
-    exit (-1);
+  fprintf ( stderr, "VCDTSVM: unable to read from stream! please use save()\n" );
+  exit ( -1 );
 }

+ 50 - 50
classifier/vclassifier/VCDTSVM.h

@@ -1,4 +1,4 @@
-/** 
+/**
 * @file VCDTSVM.h
 * @brief Interface to DTSVM
 * @author Björn Fröhlich
@@ -20,55 +20,55 @@ namespace OBJREC {
 class VCDTSVM : public VecClassifier
 {
 
-	protected:
-		NICE::Vector max;
-		NICE::Vector min;
-
-		int normalization_type;
-		
-		/** where to find the binary file */
-		std::string binary;
-		
-		/** where to find the DT-SVM config files */
-		std::string configtrain;
-		std::string configtest;
-		std::string trainfile;
-		std::string testfile;
-		
-	private:
-		std::vector<std::vector<double> > results;
-		std::vector<int> *counter;
-		//int counter;
-		std::vector<int> labels;		
-
-	public:
-		/** using a config file to read some settings */
-		VCDTSVM( const NICE::Config *conf, const std::string & section = "VCDTSVM" );
-
-		/** simple copy constructor */
-		VCDTSVM ( const VCDTSVM & src );
-	  
-		/** simple destructor */
-		virtual ~VCDTSVM();
-		 
-		/** classify using simple vector */
-		ClassificationResult classify ( const NICE::Vector & x ) const;
-
-		/** classify using a simple vector */
-		void teach ( const LabeledSetVector & teachSet );
-		
-		void finishTeaching();
-
-		/** clone this object */
-		virtual VCDTSVM *clone(void) const;
-
-		void clear ();
-
-		void read (const std::string& s, int format = 0);
-		void save (const std::string& s, int format = 0) const;
-
-		void store ( std::ostream & os, int format = 0 ) const;
-		void restore ( std::istream & is, int format = 0 );
+  protected:
+    NICE::Vector max;
+    NICE::Vector min;
+
+    int normalization_type;
+
+    /** where to find the binary file */
+    std::string binary;
+
+    /** where to find the DT-SVM config files */
+    std::string configtrain;
+    std::string configtest;
+    std::string trainfile;
+    std::string testfile;
+
+  private:
+    std::vector<std::vector<double> > results;
+    std::vector<int> *counter;
+    //int counter;
+    std::vector<int> labels;
+
+  public:
+    /** using a config file to read some settings */
+    VCDTSVM ( const NICE::Config *conf, const std::string & section = "VCDTSVM" );
+
+    /** simple copy constructor */
+    VCDTSVM ( const VCDTSVM & src );
+
+    /** simple destructor */
+    virtual ~VCDTSVM();
+
+    /** classify using simple vector */
+    ClassificationResult classify ( const NICE::Vector & x ) const;
+
+    /** classify using a simple vector */
+    void teach ( const LabeledSetVector & teachSet );
+
+    void finishTeaching();
+
+    /** clone this object */
+    virtual VCDTSVM *clone ( void ) const;
+
+    void clear ();
+
+    void read ( const std::string& s, int format = 0 );
+    void save ( const std::string& s, int format = 0 ) const;
+
+    void store ( std::ostream & os, int format = 0 ) const;
+    void restore ( std::istream & is, int format = 0 );
 };