VCLogisticRegression.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #include "core/vector/VectorT.h"
  10. #include "core/vector/MatrixT.h"
  11. #include "vislearning/classifier/classifierbase/VecClassifier.h"
  12. namespace OBJREC {
  13. /** Simple Gaussian Classifier */
  14. class VCLogisticRegression : public VecClassifier
  15. {
  16. protected:
  17. /** setting, whether to use ML-estimation
  18. or MAP-estimation */
  19. bool mlestimation;
  20. /** parameters of the sigmoid function
  21. 1.0 / (1.0 + exp(A*x + B) ) */
  22. double sigmoidA;
  23. double sigmoidB;
  24. public:
  25. /** simple constructor using config values */
  26. VCLogisticRegression( const NICE::Config *conf);
  27. /** simple constructor */
  28. VCLogisticRegression();
  29. /** simple destructor */
  30. virtual ~VCLogisticRegression();
  31. /** classify using simple vector */
  32. ClassificationResult classify ( const NICE::Vector & x ) const;
  33. /** classify using a simple vector */
  34. void teach ( const LabeledSetVector & teachSet );
  35. void finishTeaching() {};
  36. /** clone this object */
  37. virtual VCLogisticRegression *clone(void) const;
  38. void clear ();
  39. void store ( std::ostream & os, int format = 0 ) const;
  40. void restore ( std::istream & is, int format = 0 );
  41. };
  42. } // namespace
  43. #endif