KCGPRegression.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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(NICE::Exception, "Persistent interface not implemented!");
  15. namespace OBJREC
  16. {
  17. /** Gaussian Process Regression for Classification */
  18. class KCGPRegression : public KernelClassifier
  19. {
  20. protected:
  21. RegressionAlgorithmKernel *regressionAlgorithm;
  22. NICE::Vector y;
  23. public:
  24. /** simple constructor */
  25. KCGPRegression ( const NICE::Config *conf, Kernel *kernel = NULL, const std::string & section = "KCGPRegression" );
  26. /** copy constructor */
  27. KCGPRegression ( const KCGPRegression & src );
  28. /** simple destructor */
  29. virtual ~KCGPRegression();
  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. virtual ClassificationResult classifyKernel ( const NICE::Vector & kernelVector, double kernelSelf ) const;
  35. /** clone this object */
  36. KCGPRegression *clone() const;
  37. void restore ( std::istream&, int )
  38. {
  39. ROADWORKS
  40. };
  41. void store ( std::ostream&, int ) const
  42. {
  43. ROADWORKS
  44. };
  45. void clear()
  46. {
  47. ROADWORKS
  48. };
  49. bool getOptimizeKernelParameters () const;
  50. };
  51. }
  52. #undef ROADWORKS
  53. #endif