GestureRecognitionToolkit  Version: 0.1.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
MinDistModel.h
Go to the documentation of this file.
1 
29 #ifndef GRT_MINDISTMODEL_HEADER
30 #define GRT_MINDISTMODEL_HEADER
31 
32 #include "../../Util/GRTCommon.h"
33 #include "../../ClusteringModules/KMeans/KMeans.h"
34 
35 GRT_BEGIN_NAMESPACE
36 
38 {
39 public:
40 
44  MinDistModel();
45 
49  MinDistModel(const MinDistModel &rhs);
50 
54  ~MinDistModel(void);
55 
62  MinDistModel &operator=(const MinDistModel &rhs);
63 
64  bool train(UINT classLabel,MatrixFloat &trainingData,UINT numClusters,Float minChange,UINT maxNumEpochs);
65  Float predict(const VectorFloat &observation);
66  void recomputeThresholdValue();
67 
68  UINT getClassLabel() const;
69  UINT getNumFeatures() const;
70  UINT getNumClusters() const;
71  UINT getDistanceMode() const;
72  Float getRejectionThreshold() const;
73  Float getGamma() const;
74  Float getTrainingMu() const;
75  Float getTrainingSigma() const;
76  MatrixFloat getClusters() const;
77 
78  bool setClassLabel(UINT classLabel);
79  bool setClusters(MatrixFloat &clusters);
80  bool setGamma(Float gamma);
81  bool setRejectionThreshold(Float rejectionThreshold);
82  bool setTrainingSigma(Float trainingSigma);
83  bool setTrainingMu(Float trainingMu);
84 
85 private:
86  Float SQR(Float x){ return x*x; }
87  UINT classLabel;
88  UINT numFeatures;
89  UINT numClusters;
90  Float rejectionThreshold; //The classification threshold value
91  Float gamma; //The number of standard deviations to use for the threshold
92  Float trainingMu; //The average confidence value in the training data
93  Float trainingSigma; //The simga confidence value in the training data
94  MatrixFloat clusters;
95 };
96 
97 GRT_END_NAMESPACE
98 
99 #endif //GRT_MINDISTMODEL_HEADER
100 
~MinDistModel(void)
MinDistModel & operator=(const MinDistModel &rhs)