VCLogisticRegression.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * @file VCLogisticRegression.h
  3. * @brief Simple Gaussian Classifier
  4. * @author Erik Rodner
  5. * @date 12/05/2007
  6. */
  7. #ifndef VCLogisticRegressionINCLUDE
  8. #define VCLogisticRegressionINCLUDE
  9. #ifdef NOVISUAL
  10. #include <vislearning/nice_nonvis.h>
  11. #else
  12. #include <vislearning/nice.h>
  13. #endif
  14. #include "vislearning/classifier/classifierbase/VecClassifier.h"
  15. namespace OBJREC {
  16. /** Simple Gaussian Classifier */
  17. class VCLogisticRegression : public VecClassifier
  18. {
  19. protected:
  20. /** setting, whether to use ML-estimation
  21. or MAP-estimation */
  22. bool mlestimation;
  23. /** parameters of the sigmoid function
  24. 1.0 / (1.0 + exp(A*x + B) ) */
  25. double sigmoidA;
  26. double sigmoidB;
  27. public:
  28. /** simple constructor using config values */
  29. VCLogisticRegression( const NICE::Config *conf);
  30. /** simple constructor */
  31. VCLogisticRegression();
  32. /** simple destructor */
  33. virtual ~VCLogisticRegression();
  34. /** classify using simple vector */
  35. ClassificationResult classify ( const NICE::Vector & x ) const;
  36. /** classify using a simple vector */
  37. void teach ( const LabeledSetVector & teachSet );
  38. void finishTeaching() {};
  39. /** clone this object */
  40. virtual VCLogisticRegression *clone(void) const;
  41. void clear ();
  42. void store ( std::ostream & os, int format = 0 ) const;
  43. void restore ( std::istream & is, int format = 0 );
  44. };
  45. } // namespace
  46. #endif