KCGPRegression.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * @file KCGPRegression.h
  3. * @brief Gaussian Process Regression for Classification
  4. * @author Erik Rodner
  5. * @date 12/03/2009
  6. */
  7. #ifndef KCGPREGRESSIONINCLUDE
  8. #define KCGPREGRESSIONINCLUDE
  9. #include "vislearning/classifier/classifierbase/KernelClassifier.h"
  10. #include "vislearning/math/kernels/ParameterizedKernel.h"
  11. #include "vislearning/regression/regressionbase/RegressionAlgorithmKernel.h"
  12. #include "vislearning/regression/regressionbase/TeachWithInverseKernelMatrix.h"
  13. #undef ROADWORKS
  14. #define ROADWORKS fthrow(Exception, "Persistent interface not implemented!");
  15. namespace OBJREC {
  16. /** Gaussian Process Regression for Classification */
  17. class KCGPRegression : public KernelClassifier
  18. {
  19. protected:
  20. RegressionAlgorithmKernel *regressionAlgorithm;
  21. NICE::Vector y;
  22. public:
  23. /** simple constructor */
  24. KCGPRegression( const NICE::Config *conf, Kernel *kernel = NULL, const std::string & section = "KCGPRegression" );
  25. /** copy constructor */
  26. KCGPRegression( const KCGPRegression & src );
  27. /** simple destructor */
  28. virtual ~KCGPRegression();
  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. virtual ClassificationResult classifyKernel ( const NICE::Vector & kernelVector, double kernelSelf ) const;
  34. /** clone this object */
  35. KCGPRegression *clone() const;
  36. void restore(std::istream&, int) { ROADWORKS };
  37. void store(std::ostream&, int) const { ROADWORKS };
  38. void clear() { ROADWORKS };
  39. bool getOptimizeKernelParameters () const;
  40. };
  41. }
  42. #undef ROADWORKS
  43. #endif