FPCnone.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * @file FPCnone.h
  3. * @brief bad hack, not realy a classifier, returns the first values as classification result
  4. * @author Björn Fröhlich
  5. * @date 18/06/2010
  6. */
  7. #ifndef FPCnoneDEF
  8. #define FPCnoneDEF
  9. #include <objrec/nice.h>
  10. #include "vislearning/classifier/classifierbase/FeaturePoolClassifier.h"
  11. #include "vislearning/classifier/fpclassifier/logisticregression/SLR.h"
  12. #include "vislearning/cbaselib/FeaturePool.h"
  13. #include "vislearning/math/algebra/GMSparse2.h"
  14. namespace OBJREC {
  15. class FPCnone : public FeaturePoolClassifier
  16. {
  17. protected:
  18. //! the featurepool
  19. FeaturePool fp;
  20. //! config file;
  21. const Config *conf;
  22. public:
  23. /**
  24. * standard constructor
  25. * @param conf configfile
  26. * @param section section name in configfile for classifier
  27. */
  28. FPCnone( const Config *conf, std::string section="SMLR");
  29. /**
  30. * simple constructor -> does nothing
  31. */
  32. FPCnone ();
  33. /**
  34. * simple destructor
  35. */
  36. ~FPCnone();
  37. /**
  38. * main classification function
  39. * @param pce input feature
  40. * @return a classification result
  41. */
  42. ClassificationResult classify ( Example & pce );
  43. /**
  44. * start training
  45. * @param fp a featurepool (how to handle which features...)
  46. * @param examples input features
  47. */
  48. void train ( FeaturePool & _fp, Examples & examples );
  49. /**
  50. * clone this object
  51. * @return a copy of this object
  52. */
  53. FeaturePoolClassifier *clone () const;
  54. /**
  55. * set complexity for the next training process e.g. number of weak classifiers
  56. * @param size new complexity
  57. */
  58. void setComplexity ( int size );
  59. /** IO functions */
  60. void restore (std::istream & is, int format = 0);
  61. void store (std::ostream & os, int format = 0) const;
  62. void clear ();
  63. };
  64. } // namespace
  65. #endif