GestureRecognitionToolkit  Version: 0.2.5
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 
37 class GRT_API MinDistModel
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  bool setTrainingLoggingEnabled(bool enabled);
85 
86 private:
87  Float SQR(const Float &x){ return (x*x); }
88  bool trainingLoggingEnabled;
89  UINT classLabel;
90  UINT numFeatures;
91  UINT numClusters;
92  Float rejectionThreshold; //The classification threshold value
93  Float gamma; //The number of standard deviations to use for the threshold
94  Float trainingMu; //The average confidence value in the training data
95  Float trainingSigma; //The simga confidence value in the training data
96  MatrixFloat clusters;
97 };
98 
99 GRT_END_NAMESPACE
100 
101 #endif //GRT_MINDISTMODEL_HEADER
102