ClassificationResults.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * @file ClassificationResults.h
  3. // refactor-nice.pl: check this substitution
  4. // old: * @brief vector of ClassificationResult's
  5. * @brief std::vector of ClassificationResult's
  6. * @author Erik Rodner
  7. * @date 02/13/2008
  8. */
  9. #ifndef CLASSIFICATIONRESULTSINCLUDE
  10. #define CLASSIFICATIONRESULTSINCLUDE
  11. #include "core/image/ImageT.h"
  12. #include "core/vector/VectorT.h"
  13. #include "core/vector/MatrixT.h"
  14. #include <vector>
  15. #include "ClassificationResult.h"
  16. namespace OBJREC {
  17. /** vector of ClassificationResult's
  18. @see ClassificationResult */
  19. class ClassificationResults : public std::vector<ClassificationResult>
  20. {
  21. public:
  22. enum {
  23. PERF_AVG_PRECISION_11_POINT = 0,
  24. PERF_AUC = 1,
  25. PERF_AVG_PRECISION
  26. };
  27. protected:
  28. public:
  29. /** simple constructor */
  30. ClassificationResults();
  31. /** simple destructor */
  32. virtual ~ClassificationResults();
  33. /** write BINARY classification results in WEKA format
  34. suitable for drawing ROC curves
  35. @param filename write results to filename
  36. @param classno class number of object class within the binary classification setting
  37. */
  38. void writeWEKA ( const std::string & filename, int classno ) const;
  39. /** please choose the type from the public enum,
  40. * this only works for binary classification problems */
  41. double getBinaryClassPerformance ( int type = PERF_AUC ) const;
  42. /** return average recognition rate, useful for multi-class problems */
  43. double getAverageRecognitionRate() const;
  44. /** return overall recognition rate, useful for multi-class problems */
  45. double getOverallRecognitionRate() const;
  46. };
  47. } // namespace
  48. #endif