KCOneVsAll.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. {
  11. #undef ROADWORKS
  12. #define ROADWORKS fthrow(NICE::Exception, "Persistent interface not implemented!");
  13. /** @class KCOneVsAll
  14. * One vs. All interface for kernel classifiers
  15. *
  16. * @author Erik Rodner
  17. */
  18. class KCOneVsAll : public KernelClassifier
  19. {
  20. protected:
  21. std::vector< std::pair<int, KernelClassifier *> > classifiers;
  22. const KernelClassifier *prototype;
  23. double noiseSigma;
  24. bool verbose;
  25. public:
  26. /** simple constructor */
  27. KCOneVsAll ( const NICE::Config *conf, const KernelClassifier *prototype, const std::string & section = "KCOneVsAll" );
  28. /** simple destructor */
  29. virtual ~KCOneVsAll();
  30. /** teach the classifier with a kernel matrix and the corresponding class labels @param y ! */
  31. void teach ( KernelData *kernelData, const NICE::Vector & y );
  32. /** classify an example by using its kernel values with the training set,
  33. be careful with the order in @param kernelVector */
  34. ClassificationResult classifyKernel ( const NICE::Vector & kernelVector, double kernelSelf ) const;
  35. void restore ( std::istream&, int )
  36. {
  37. ROADWORKS
  38. };
  39. void store ( std::ostream&, int ) const
  40. {
  41. ROADWORKS
  42. };
  43. void clear()
  44. {
  45. ROADWORKS
  46. };
  47. };
  48. #undef ROADWORKS
  49. }
  50. #endif