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.
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 GRT_BEGIN_NAMESPACE
37 
39 public:
40 
49  UnlabelledData(const UINT numDimensions = 0,const std::string datasetName = "NOT_SET",const std::string infoText = "");
50 
56  UnlabelledData(const UnlabelledData &rhs);
57 
62 
70 
78  inline VectorFloat& operator[] (const UINT &i){
79  return data[i];
80  }
81 
89  const inline VectorFloat& operator[] (const UINT &i) const{
90  return data[i];
91  }
92 
96  void clear();
97 
108  bool setNumDimensions(const UINT numDimensions);
109 
118  bool setDatasetName(const std::string datasetName);
119 
127  bool setInfoText(const std::string infoText);
128 
136  bool addSample(const VectorFloat &sample);
137 
143  bool removeLastSample();
144 
153  bool reserve(const UINT N);
154 
163  bool setExternalRanges(const Vector< MinMax > &externalRanges, const bool useExternalRanges = false);
164 
172  bool enableExternalRangeScaling(const bool useExternalRanges);
173 
181  bool scale(const Float minTarget,const Float maxTarget);
182 
191  bool scale(const Vector<MinMax> &ranges,const Float minTarget,const Float maxTarget);
192 
201  bool save(const std::string &filename) const;
202 
211  bool load(const std::string &filename);
212 
219  bool saveDatasetToFile(const std::string &filename) const;
220 
227  bool loadDatasetFromFile(const std::string &filename);
228 
237  bool saveDatasetToCSVFile(const std::string &filename) const;
238 
248  bool loadDatasetFromCSVFile(const std::string &filename);
249 
257  UnlabelledData partition(const UINT partitionPercentage);
258 
266  bool merge(const UnlabelledData &unlabelledData);
267 
274  bool spiltDataIntoKFolds(const UINT K);
275 
283  UnlabelledData getTrainingFoldData(const UINT foldIndex) const;
284 
292  UnlabelledData getTestFoldData(const UINT foldIndex) const;
293 
299  std::string getDatasetName() const{ return datasetName; }
300 
306  std::string getInfoText() const{ return infoText; }
307 
313  std::string getStatsAsString() const;
314 
320  UINT inline getNumDimensions() const{ return numDimensions; }
321 
327  UINT inline getNumSamples() const{ return totalNumSamples; }
328 
334  Vector<MinMax> getRanges() const;
335 
342 
349 
356 
357 private:
358  std::string datasetName;
359  std::string infoText;
360  UINT numDimensions;
361  UINT totalNumSamples;
362  UINT kFoldValue;
363  bool crossValidationSetup;
364  bool useExternalRanges;
365  Vector< MinMax > externalRanges;
366 
367  Vector< VectorFloat > data;
368  Vector< Vector< UINT > > crossValidationIndexs;
369 
370  DebugLog debugLog;
371  ErrorLog errorLog;
372  WarningLog warningLog;
373 
374 };
375 
376 GRT_END_NAMESPACE
377 
378 #endif //GRT_UNLABLELLED_CLASSIFICATION_DATA_HEADER
bool loadDatasetFromCSVFile(const std::string &filename)
bool scale(const Float minTarget, const Float maxTarget)
bool addSample(const VectorFloat &sample)
std::string getDatasetName() const
bool load(const std::string &filename)
MatrixFloat getDataAsMatrixFloat() const
std::string getInfoText() const
UINT getNumDimensions() const
bool setExternalRanges(const Vector< MinMax > &externalRanges, const bool useExternalRanges=false)
UINT getNumSamples() const
UnlabelledData & operator=(const UnlabelledData &rhs)
bool reserve(const UINT N)
Vector< VectorFloat > getData() const
UnlabelledData getTestFoldData(const UINT foldIndex) const
UnlabelledData(const UINT numDimensions=0, const std::string datasetName="NOT_SET", const std::string infoText="")
bool save(const std::string &filename) const
bool saveDatasetToFile(const std::string &filename) const
bool setNumDimensions(const UINT numDimensions)
bool enableExternalRangeScaling(const bool useExternalRanges)
VectorFloat & operator[](const UINT &i)
UnlabelledData partition(const UINT partitionPercentage)
bool setInfoText(const std::string infoText)
bool saveDatasetToCSVFile(const std::string &filename) const
Vector< MinMax > getRanges() const
UnlabelledData getTrainingFoldData(const UINT foldIndex) const
MatrixDouble getDataAsMatrixDouble() const
bool merge(const UnlabelledData &unlabelledData)
bool setDatasetName(const std::string datasetName)
bool spiltDataIntoKFolds(const UINT K)
bool loadDatasetFromFile(const std::string &filename)
std::string getStatsAsString() const