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.
LinearRegression.h
Go to the documentation of this file.
1 
26 #ifndef GRT_LINEAR_REGRESSION_HEADER
27 #define GRT_LINEAR_REGRESSION_HEADER
28 
29 #include "../../CoreModules/Regressifier.h"
30 
31 GRT_BEGIN_NAMESPACE
32 
38 class GRT_API LinearRegression : public Regressifier
39 {
40  public:
46  LinearRegression(bool useScaling=false);
47 
54 
58  virtual ~LinearRegression(void);
59 
66  LinearRegression &operator=(const LinearRegression &rhs);
67 
75  virtual bool deepCopyFrom(const Regressifier *regressifier);
76 
84  virtual bool train_(RegressionData &trainingData);
85 
93  virtual bool predict_(VectorFloat &inputVector);
94 
102  virtual bool save( std::fstream &file ) const;
103 
111  virtual bool load( std::fstream &file );
112 
118  UINT getMaxNumIterations() const;
119 
127  bool setMaxNumIterations(const UINT maxNumIterations);
128 
134  static std::string getId();
135 
136  //Tell the compiler we are using the base class train method to stop hidden virtual function warnings
137  using MLBase::save;
138  using MLBase::load;
139 
140 protected:
141  bool loadLegacyModelFromFile( std::fstream &file );
142 
143  Float w0;
144  VectorFloat w;
145 
146 private:
148  static const std::string id;
149 };
150 
151 GRT_END_NAMESPACE
152 
153 #endif //GRT_LINEAR_REGRESSION_HEADER
154 
std::string getId() const
Definition: GRTBase.cpp:85
virtual bool predict_(VectorFloat &inputVector)
Definition: MLBase.cpp:137
virtual bool save(const std::string &filename) const
Definition: MLBase.cpp:167
virtual bool deepCopyFrom(const Regressifier *regressifier)
Definition: Regressifier.h:64
virtual bool train_(ClassificationData &trainingData)
Definition: MLBase.cpp:109
virtual bool load(const std::string &filename)
Definition: MLBase.cpp:190