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.
RegressionSample.h
Go to the documentation of this file.
1 
29 #ifndef GRT_REGRESSION_SAMPLE_HEADER
30 #define GRT_REGRESSION_SAMPLE_HEADER
31 
32 #include "../Util/GRTCommon.h"
33 
34 GRT_BEGIN_NAMESPACE
35 
37 public:
39  RegressionSample(const VectorFloat &inputVector,const VectorFloat &targetVector);
42 
43  RegressionSample& operator= (const RegressionSample &rhs){
44  if( this != &rhs){
45  this->inputVector = rhs.inputVector;
46  this->targetVector = rhs.targetVector;
47  }
48  return *this;
49  }
50 
51 
52  static bool sortByInputVectorAscending(const RegressionSample &a,const RegressionSample &b){
53  return a.inputVector < b.inputVector;
54  }
55 
56  static bool sortByInputVectorDescending(const RegressionSample &a,const RegressionSample &b){
57  return a.inputVector > b.inputVector;
58  }
59 
60  void clear();
61  void set(const VectorFloat &inputVector,const VectorFloat &targetVector);
62 
63  UINT getNumInputDimensions() const;
64  UINT getNumTargetDimensions() const;
65  Float getInputVectorValue(const UINT index) const;
66  Float getTargetVectorValue(const UINT index) const;
67  const VectorFloat& getInputVector() const;
68  const VectorFloat& getTargetVector() const;
69 
70 private:
71  VectorFloat inputVector;
72  VectorFloat targetVector;
73 };
74 
75 GRT_END_NAMESPACE
76 
77 #endif //GRT_REGRESSION_SAMPLE_HEADER