GestureRecognitionToolkit  Version: 1.0 Revision: 04-03-15
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
UnlabelledData.h
Go to the documentation of this file.
1 
31 #ifndef GRT_UNLABLELLED_DATA_HEADER
32 #define GRT_UNLABLELLED_DATA_HEADER
33 
34 #include "../Util/GRTCommon.h"
35 
36 namespace GRT{
37 
39 public:
40 
49  UnlabelledData(const UINT numDimensions = 0,const string datasetName = "NOT_SET",const string infoText = "");
50 
56  UnlabelledData(const UnlabelledData &rhs);
57 
62 
70 
78  inline VectorDouble& operator[] (const UINT &i){
79  return data[i];
80  }
81 
89  const inline VectorDouble& operator[] (const UINT &i) const{
90  return data[i];
91  }
92 
96  void clear();
97 
108  bool setNumDimensions(const UINT numDimensions);
109 
117  bool setDatasetName(const string datasetName);
118 
126  bool setInfoText(const string infoText);
127 
135  bool addSample(const VectorDouble &sample);
136 
142  bool removeLastSample();
143 
152  bool reserve(const UINT N);
153 
162  bool setExternalRanges(const vector< MinMax > &externalRanges, const bool useExternalRanges = false);
163 
171  bool enableExternalRangeScaling(const bool useExternalRanges);
172 
178  bool scale(const double minTarget,const double maxTarget);
179 
185  bool scale(const vector<MinMax> &ranges,const double minTarget,const double maxTarget);
186 
195  bool save(const string &filename) const;
196 
205  bool load(const string &filename);
206 
213  bool saveDatasetToFile(const string &filename) const;
214 
221  bool loadDatasetFromFile(const string &filename);
222 
231  bool saveDatasetToCSVFile(const string &filename) const;
232 
242  bool loadDatasetFromCSVFile(const string &filename);
243 
251  UnlabelledData partition(const UINT partitionPercentage);
252 
260  bool merge(const UnlabelledData &unlabelledData);
261 
268  bool spiltDataIntoKFolds(const UINT K);
269 
277  UnlabelledData getTrainingFoldData(const UINT foldIndex) const;
278 
286  UnlabelledData getTestFoldData(const UINT foldIndex) const;
287 
293  string getDatasetName() const{ return datasetName; }
294 
300  string getInfoText() const{ return infoText; }
301 
307  string getStatsAsString() const;
308 
314  UINT inline getNumDimensions() const{ return numDimensions; }
315 
321  UINT inline getNumSamples() const{ return totalNumSamples; }
322 
328  vector<MinMax> getRanges() const;
329 
335  vector< VectorDouble > getData() const;
336 
343 
344 private:
345  string datasetName;
346  string infoText;
347  UINT numDimensions;
348  UINT totalNumSamples;
349  UINT kFoldValue;
350  bool crossValidationSetup;
351  bool useExternalRanges;
352  vector< MinMax > externalRanges;
353 
354  vector< VectorDouble > data;
355  vector< vector< UINT > > crossValidationIndexs;
356 
357  DebugLog debugLog;
358  ErrorLog errorLog;
359  WarningLog warningLog;
360 
361 };
362 
363 } //End of namespace GRT
364 
365 #endif //GRT_UNLABLELLED_CLASSIFICATION_DATA_HEADER
UINT getNumSamples() const
UnlabelledData & operator=(const UnlabelledData &rhs)
bool enableExternalRangeScaling(const bool useExternalRanges)
Definition: AdaBoost.cpp:25
bool addSample(const VectorDouble &sample)
VectorDouble & operator[](const UINT &i)
bool merge(const UnlabelledData &unlabelledData)
bool scale(const double minTarget, const double maxTarget)
UnlabelledData(const UINT numDimensions=0, const string datasetName="NOT_SET", const string infoText="")
string getStatsAsString() const
bool setExternalRanges(const vector< MinMax > &externalRanges, const bool useExternalRanges=false)
bool loadDatasetFromCSVFile(const string &filename)
UnlabelledData getTestFoldData(const UINT foldIndex) const
MatrixDouble getDataAsMatrixDouble() const
bool saveDatasetToCSVFile(const string &filename) const
bool load(const string &filename)
bool saveDatasetToFile(const string &filename) const
bool setDatasetName(const string datasetName)
string getInfoText() const
bool spiltDataIntoKFolds(const UINT K)
UnlabelledData getTrainingFoldData(const UINT foldIndex) const
string getDatasetName() const
UINT getNumDimensions() const
bool loadDatasetFromFile(const string &filename)
bool reserve(const UINT N)
UnlabelledData partition(const UINT partitionPercentage)
bool setNumDimensions(const UINT numDimensions)
bool save(const string &filename) const
vector< MinMax > getRanges() const
vector< VectorDouble > getData() const
bool setInfoText(const string infoText)