26 #ifndef GRT_CLASSIFICATION_DATA_HEADER 27 #define GRT_CLASSIFICATION_DATA_HEADER 29 #include "VectorFloat.h" 30 #include "../Util/GRTCommon.h" 31 #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);
141 bool setClassNameForCorrespondingClassLabel(
const std::string className,
const UINT classLabel);
152 bool setAllowNullGestureClass(
const bool allowNullGestureClass);
163 bool addSample(
const UINT classLabel,
const VectorFloat &sample);
171 bool removeSample(
const UINT index );
178 bool removeLastSample();
188 bool reserve(
const UINT M);
198 bool addClass(
const UINT classLabel,
const std::string className =
"NOT_SET");
206 UINT removeClass(
const UINT classLabel);
217 UINT eraseAllSamplesWithClassLabel(
const UINT classLabel);
226 bool relabelAllSamplesWithClassLabel(
const UINT oldClassLabel,
const UINT newClassLabel);
236 bool setExternalRanges(
const Vector< MinMax > &externalRanges,
const bool useExternalRanges =
false);
245 bool enableExternalRangeScaling(
const bool useExternalRanges);
254 bool scale(
const Float minTarget,
const Float maxTarget);
274 bool save(
const std::string &filename)
const;
284 bool load(
const std::string &filename);
292 bool saveDatasetToFile(
const std::string &filename)
const;
300 bool loadDatasetFromFile(
const std::string &filename);
309 bool saveDatasetToCSVFile(
const std::string &filename)
const;
321 bool loadDatasetFromCSVFile(
const std::string &filename,
const UINT classLabelColumnIndex = 0);
329 bool printStats()
const;
336 bool sortClassLabels();
354 GRT_DEPRECATED_MSG(
"partition(...) is deprecated, use split(...) instead",
ClassificationData partition(
const UINT partitionPercentage,
const bool useStratifiedSampling =
false) );
364 ClassificationData split(
const UINT splitPercentage,
const bool useStratifiedSampling =
false);
373 bool spiltDataIntoKFolds(
const UINT K,
const bool useStratifiedSampling =
false);
411 ClassificationData getBootstrappedDataset(
const UINT numSamples=0,
const bool balanceDataset=
false )
const;
449 std::string getStatsAsString()
const;
477 UINT getMinimumClassLabel()
const;
484 UINT getMaximumClassLabel()
const;
492 UINT getClassLabelIndexValue(
const UINT classLabel)
const;
500 std::string getClassNameForCorrespondingClassLabel(
const UINT classLabel)
const;
537 MatrixFloat getClassHistogramData(
const UINT classLabel,
const UINT numBins)
const;
637 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 );
655 static ClassificationData generateGaussDataset(
const UINT numSamples = 10000,
const UINT numClasses = 10,
const UINT numDimensions = 3,
const Float range = 10,
const Float sigma = 1 );
674 static ClassificationData generateGaussLinearDataset(
const UINT numSamples = 10000,
const UINT numClasses = 10,
const UINT numDimensions = 3,
const Float range = 10,
const Float sigma = 1 );
678 std::string datasetName;
679 std::string infoText;
681 UINT totalNumSamples;
683 bool crossValidationSetup;
684 bool useExternalRanges;
685 bool allowNullGestureClass;
694 #endif //GRT_CLASSIFICATION_DATA_HEADER
Vector< ClassTracker > getClassTracker() const
Vector< ClassificationSample > getClassificationData() const
std::string getDatasetName() const
GRT_DEPRECATED_MSG("getClassType is deprecated, use getId() instead!", std::string getClassType() 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...
Float scale(const Float &x, const Float &minSource, const Float &maxSource, const Float &minTarget, const Float &maxTarget, const bool constrain=false)