KSquare Utilities
SizeDistribution.h
Go to the documentation of this file.
1 #ifndef _SIZEDISTRIBUTION_
2 #define _SIZEDISTRIBUTION_
3 
4 
5 //#define BucketCount 50
6 //#define BucketSize 100
7 
8 
9 #include "MLClass.h"
10 #include "FeatureVector.h"
11 #include "RunLog.h"
12 
13 class ClassTotals;
14 typedef ClassTotals* ClassTotalsPtr;
15 
16 class ClassTotalsList;
17 typedef ClassTotalsList* ClassTotalsListPtr;
18 
19 
20 namespace KKMLL
21 {
22  /**
23  *@brief Used to keep track of examples by size; typically used by 'CrossValidation'; for each example predicted
24  * it would call the ;Increment' method keeping track
25  */
27  {
28  public:
29  SizeDistribution (kkint32 _bucketCount,
30  kkint32 _bucketSize,
31  RunLog& _log
32  );
33 
34  ~SizeDistribution ();
35 
36 
37  void Increment (MLClassPtr mlClass,
38  kkint32 size
39  );
40 
41 
42  void PrintFormatedDistributionMatrix (ostream& _outFile) const;
43 
44 
45  void PrintCSVDistributionMatrix (ostream& _outFile) const;
46 
47 
48  void PrintTabDelDistributionMatrix (ostream& _outFile) const;
49 
50 
51  void PrintByClassCollumns (ostream& o,
52  VectorUlong* scanLinesPerMeter
53  ) const;
54 
55 
56  private:
57  MLClassListPtr BuildMLClassList () const;
58 
59  void PrintCSVHeader (ostream& o) const;
60  void PrintFormatedHeader (ostream& o) const;
61  void PrintTabDelHeader (ostream& o) const;
62 
63 
64  class ClassTotals;
65  class ClassTotalsList;
66 
67  typedef ClassTotalsList* ClassTotalsListPtr;
68 
69 
70 
71  kkint32 bucketCount;
72  kkint32 bucketSize;
73  RunLog& log;
74  ClassTotalsListPtr totals;
75  }; /* SizeDistribution */
76 
78 
79 } /* namespace KKMLL */
80 
81 #endif
MLClass * MLClassPtr
Definition: MLClass.h:46
ClassTotalsList * ClassTotalsListPtr
__int32 kkint32
Definition: KKBaseTypes.h:88
void Increment(MLClassPtr mlClass, kkint32 size)
void PrintTabDelDistributionMatrix(ostream &_outFile) const
SizeDistribution(kkint32 _bucketCount, kkint32 _bucketSize, RunLog &_log)
ClassTotals * ClassTotalsPtr
void PrintByClassCollumns(ostream &o, VectorUlong *scanLinesPerMeter) const
Used to keep track of examples by size; typically used by 'CrossValidation'; for each example predict...
Used for logging messages.
Definition: RunLog.h:49
void EncodeProblem(const struct svm_paramater &param, struct svm_problem &prob_in, struct svm_problem &prob_out)
SizeDistribution * SizeDistributionPtr
MLClassList * MLClassListPtr
Definition: MLClass.h:49
void PrintFormatedDistributionMatrix(ostream &_outFile) const
void PrintCSVDistributionMatrix(ostream &_outFile) const
std::vector< ulong > VectorUlong
Definition: KKBaseTypes.h:143