RegressionAlgorithm.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #define ROADWORKS fthrow(Exception, "Persistent Interface: not yet implemented.");
  12. /** interface for a regression algorithm */
  13. class RegressionAlgorithm : public NICE::Persistent
  14. {
  15. protected:
  16. public:
  17. /** simple constructor */
  18. RegressionAlgorithm();
  19. /** simple destructor */
  20. virtual ~RegressionAlgorithm();
  21. /** learn parameters/models/whatever using a set of vectors and
  22. * their corresponding function values
  23. */
  24. virtual void teach ( const NICE::VVector & x, const NICE::Vector & y ) = 0;
  25. /** predict the function value for \c x */
  26. virtual double predict ( const NICE::Vector & x ) = 0;
  27. /** persistent interface */
  28. virtual void restore (std::istream & is, int format = 0) { ROADWORKS };
  29. virtual void store (std::ostream & os, int format = 0) const { ROADWORKS };
  30. virtual void clear () { ROADWORKS };
  31. /** clone function */
  32. virtual RegressionAlgorithm *clone(void) const {
  33. fthrow(Exception, "clone() not yet implemented!\n");
  34. }
  35. };
  36. #undef ROADWORKS
  37. }
  38. #endif