VCNearestClassMean.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * @file VCNearestClassMean.h
  3. * @brief Nearest Class Mean Classifier (Naive Bayes with identity covariance matrix for all classes) -> code is based on VCSimpleGaussian and VCNearestNeighbor
  4. * @author Erik Rodner + Mi.Ke
  5. * @date 12/05/2007
  6. */
  7. #ifndef VCNEARESTCLASSMEANINCLUDE
  8. #define VCNEARESTCLASSMEANINCLUDE
  9. #include "vislearning/classifier/classifierbase/VecClassifier.h"
  10. #include <core/vector/Distance.h>
  11. #include <image_nonvis.h>
  12. namespace OBJREC {
  13. /** Simple Gaussian Classifier */
  14. class VCNearestClassMean : public VecClassifier
  15. {
  16. public:
  17. std::vector<NICE::Vector> means;
  18. std::vector<int> classNo;
  19. NICE::VectorDistance<double> *distancefunc;
  20. std::map<int, ice::Statistics *> statistics;
  21. public:
  22. /** simple constructor */
  23. VCNearestClassMean( const NICE::Config *conf, NICE::VectorDistance<double> *distancefunc = NULL );
  24. /** simple destructor */
  25. virtual ~VCNearestClassMean();
  26. /** classify using simple vector */
  27. ClassificationResult classify ( const NICE::Vector & x ) const;
  28. /** classify using a simple vector */
  29. void teach ( const LabeledSetVector & teachSet );
  30. void finishTeaching();
  31. void clear ();
  32. void store ( std::ostream & os, int format = 0 ) const;
  33. void restore ( std::istream & is, int format = 0 );
  34. };
  35. } // namespace
  36. #endif