RegressionAlgorithm.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * @file RegressionAlgorithm.h
  3. * @brief interface for a regression algorithm
  4. * @author Erik Rodner
  5. * @date 12/09/2009
  6. */
  7. #ifndef REGRESSIONALGORITHMINCLUDE
  8. #define REGRESSIONALGORITHMINCLUDE
  9. #include "core/vector/VVector.h"
  10. namespace OBJREC
  11. {
  12. #define ROADWORKS fthrow(NICE::Exception, "Persistent Interface: not yet implemented.");
  13. /** interface for a regression algorithm */
  14. class RegressionAlgorithm : public NICE::Persistent
  15. {
  16. protected:
  17. public:
  18. /** simple constructor */
  19. RegressionAlgorithm();
  20. /** simple destructor */
  21. virtual ~RegressionAlgorithm();
  22. /** learn parameters/models/whatever using a set of vectors and
  23. * their corresponding function values
  24. */
  25. virtual void teach ( const NICE::VVector & x, const NICE::Vector & y ) = 0;
  26. /** predict the function value for \c x */
  27. virtual double predict ( const NICE::Vector & x ) = 0;
  28. /** persistent interface */
  29. virtual void restore ( std::istream & is, int format = 0 )
  30. {
  31. ROADWORKS
  32. };
  33. virtual void store ( std::ostream & os, int format = 0 ) const
  34. {
  35. ROADWORKS
  36. };
  37. virtual void clear ()
  38. {
  39. ROADWORKS
  40. };
  41. /** clone function */
  42. virtual RegressionAlgorithm *clone ( void ) const
  43. {
  44. fthrow ( NICE::Exception, "clone() not yet implemented!\n" );
  45. }
  46. };
  47. #undef ROADWORKS
  48. }
  49. #endif