31 #ifndef GRT_CLASSIFICATION_DATA_HEADER
32 #define GRT_CLASSIFICATION_DATA_HEADER
34 #include "VectorFloat.h"
35 #include "../Util/GRTCommon.h"
36 #include "../CoreModules/GRTBase.h"
54 ClassificationData(UINT numDimensions = 0,std::string datasetName =
"NOT_SET",std::string infoText =
"");
112 bool setNumDimensions(UINT numDimensions);
121 bool setDatasetName(std::string datasetName);
130 bool setInfoText(std::string infoText);
139 bool setClassNameForCorrespondingClassLabel(std::string className,UINT classLabel);
149 bool setAllowNullGestureClass(
bool allowNullGestureClass);
160 bool addSample(UINT classLabel,
const VectorFloat &sample);
167 bool removeSample(
const UINT index );
174 bool removeLastSample();
184 bool reserve(
const UINT N);
194 bool addClass(
const UINT classLabel,
const std::string className =
"NOT_SET");
202 UINT removeClass(
const UINT classLabel);
213 UINT eraseAllSamplesWithClassLabel(
const UINT classLabel);
222 bool relabelAllSamplesWithClassLabel(
const UINT oldClassLabel,
const UINT newClassLabel);
232 bool setExternalRanges(
const Vector< MinMax > &externalRanges,
const bool useExternalRanges =
false);
241 bool enableExternalRangeScaling(
const bool useExternalRanges);
248 bool scale(
const Float minTarget,
const Float maxTarget);
255 bool scale(
const Vector<MinMax> &ranges,
const Float minTarget,
const Float maxTarget);
265 bool save(
const std::string &filename)
const;
275 bool load(
const std::string &filename);
283 bool saveDatasetToFile(
const std::string &filename)
const;
291 bool loadDatasetFromFile(
const std::string &filename);
300 bool saveDatasetToCSVFile(
const std::string &filename)
const;
312 bool loadDatasetFromCSVFile(
const std::string &filename,
const UINT classLabelColumnIndex = 0);
320 bool printStats()
const;
327 bool sortClassLabels();
345 GRT_DEPRECATED_MSG(
"partition(...) is deprecated, use split(...) instead",
ClassificationData partition(
const UINT partitionPercentage,
const bool useStratifiedSampling =
false) );
355 ClassificationData split(
const UINT splitPercentage,
const bool useStratifiedSampling =
false);
364 bool spiltDataIntoKFolds(
const UINT K,
const bool useStratifiedSampling =
false);
402 ClassificationData getBootstrappedDataset(UINT numSamples=0,
bool balanceDataset=
false )
const;
440 std::string getStatsAsString()
const;
468 UINT getMinimumClassLabel()
const;
475 UINT getMaximumClassLabel()
const;
482 UINT getClassLabelIndexValue(
const UINT classLabel)
const;
489 std::string getClassNameForCorrespondingClassLabel(
const UINT classLabel)
const;
526 MatrixFloat getClassHistogramData(
const UINT classLabel,
const UINT numBins)
const;
626 static bool generateGaussDataset(
const std::string filename,
const UINT numSamples = 10000,
const UINT numClasses = 10,
const UINT numDimensions = 3,
const Float range = 10,
const Float sigma = 1 );
630 std::string datasetName;
631 std::string infoText;
633 UINT totalNumSamples;
635 bool crossValidationSetup;
636 bool useExternalRanges;
637 bool allowNullGestureClass;
646 #endif //GRT_CLASSIFICATION_DATA_HEADER
Vector< ClassTracker > getClassTracker() const
Vector< ClassificationSample > getClassificationData() const
std::string getDatasetName() const
The UnlabelledData class is the main data container for supporting unsupervised learning.
UINT getNumSamples() const
UINT getNumDimensions() const
UINT getNumClasses() const
The RegressionData is the main data structure for recording, labeling, managing, saving, and loading datasets that can be used to train and test the GRT supervised regression algorithms.
std::string getInfoText() const
This class stores the class label and raw data for a single labelled classification sample...