KSquare Utilities
ClassStatistic.h
Go to the documentation of this file.
1 #if !defined(_CLASSSTATISTIC_)
2 #define _CLASSSTATISTIC_
3 
4 #include "KKBaseTypes.h"
5 #include "KKStr.h"
6 
7 #include "MLClass.h"
8 
9 namespace KKMLL
10 {
11  /**
12  *@brief Used by routines that retrieve Class statistics from FeatureVectorList instances.
13  */
15  {
16  public:
17  ClassStatistic (const ClassStatistic& right);
18 
19  ClassStatistic (MLClassPtr _mlClass,
20  kkuint32 _count
21  );
22 
23  kkuint32 Count () const {return count;}
24  MLClassPtr MLClass () const {return mlClass;}
25 
26  void Increment () {count++;}
27 
28  const KKStr& Name () const;
29 
30  const ClassStatistic& operator+= (const ClassStatistic& right);
31 
32  private:
33  MLClassPtr mlClass; /**< Does not own the mlClass object. */
34  kkuint32 count; /**< represents the number of FeatureVector derived instances in a FeatureVectorList that point to mageClass */
35  };
36 
37 
39 
40 
42  {
43  public:
44  ClassStatisticList (bool _owner);
45 
46  ClassStatisticPtr LookUpByMLClass (MLClassPtr mlClass) const;
47 
48  void SortByClassName ();
49  void SortByCount ();
50 
51  void PushOnBack (ClassStatisticPtr stat);
52  void PushOnFront (ClassStatisticPtr stat);
53 
54  void PrintReport (std::ostream& r);
55 
56  kkint32 operator[] (MLClassPtr mlClass);
57  const ClassStatisticList& operator+= (const ClassStatisticList& right);
58 
59  private:
61 
62  std::map<MLClassPtr, ClassStatisticPtr> imageClassIndex;
63 
65  }; /* ClassStatisticList */
66 
68 } /* namespace KKMLL */
69 
70 #define _ClassStatistic_Defined_
71 
72 #endif
const KKStr & Name() const
__int32 kkint32
Definition: KKBaseTypes.h:88
MLClassPtr MLClass() const
const ClassStatistic & operator+=(const ClassStatistic &right)
void PushOnBack(ClassStatisticPtr stat)
ClassStatisticPtr LookUpByMLClass(MLClassPtr mlClass) const
ClassStatistic(const ClassStatistic &right)
ClassStatistic * ClassStatisticPtr
void PrintReport(std::ostream &r)
unsigned __int32 kkuint32
Definition: KKBaseTypes.h:89
kkuint32 Count() const
const ClassStatisticList & operator+=(const ClassStatisticList &right)
kkint32 operator[](MLClassPtr mlClass)
void PushOnFront(ClassStatisticPtr stat)
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of &#39;std::string&#39; strings.
Definition: KKStr.cpp:1082
ClassStatisticList * ClassStatisticListPtr
Used by routines that retrieve Class statistics from FeatureVectorList instances. ...
ClassStatistic(MLClassPtr _mlClass, kkuint32 _count)
void EncodeProblem(const struct svm_paramater &param, struct svm_problem &prob_in, struct svm_problem &prob_out)