KCOneVsAll.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * @file KCOneVsAll.h
  3. * @author Erik Rodner
  4. * @date 12/10/2009
  5. */
  6. #ifndef _NICE_OBJREC_KCONEVSALLINCLUDE
  7. #define _NICE_OBJREC_KCONEVSALLINCLUDE
  8. #include "vislearning/classifier/classifierbase/KernelClassifier.h"
  9. namespace OBJREC {
  10. #undef ROADWORKS
  11. #define ROADWORKS fthrow(Exception, "Persistent interface not implemented!");
  12. /** @class KCOneVsAll
  13. * One vs. All interface for kernel classifiers
  14. *
  15. * @author Erik Rodner
  16. */
  17. class KCOneVsAll : public KernelClassifier
  18. {
  19. protected:
  20. std::vector< std::pair<int, KernelClassifier *> > classifiers;
  21. const KernelClassifier *prototype;
  22. double noiseSigma;
  23. bool verbose;
  24. public:
  25. /** simple constructor */
  26. KCOneVsAll( const NICE::Config *conf, const KernelClassifier *prototype, const std::string & section = "KCOneVsAll" );
  27. /** simple destructor */
  28. virtual ~KCOneVsAll();
  29. /** teach the classifier with a kernel matrix and the corresponding class labels @param y ! */
  30. void teach ( KernelData *kernelData, const NICE::Vector & y );
  31. /** classify an example by using its kernel values with the training set,
  32. be careful with the order in @param kernelVector */
  33. ClassificationResult classifyKernel ( const NICE::Vector & kernelVector, double kernelSelf ) const;
  34. void restore(std::istream&, int) { ROADWORKS };
  35. void store(std::ostream&, int) const { ROADWORKS };
  36. void clear() { ROADWORKS };
  37. };
  38. #undef ROADWORKS
  39. }
  40. #endif