31 #ifndef GRT_CLASSIFICATION_DATA_HEADER
32 #define GRT_CLASSIFICATION_DATA_HEADER
34 #include "../Util/GRTCommon.h"
35 #include "../CoreModules/GRTBase.h"
53 ClassificationData(UINT numDimensions = 0,
string datasetName =
"NOT_SET",
string infoText =
"");
160 bool addSample(UINT classLabel,
const VectorDouble &sample);
194 bool addClass(
const UINT classLabel,
const std::string className =
"NOT_SET");
232 bool setExternalRanges(
const vector< MinMax > &externalRanges,
const bool useExternalRanges =
false);
248 bool scale(
const double minTarget,
const double maxTarget);
255 bool scale(
const vector<MinMax> &ranges,
const double minTarget,
const double maxTarget);
265 bool save(
const string &filename)
const;
275 bool load(
const string &filename);
535 VectorDouble getClassProbabilities()
const;
537 VectorDouble getClassProbabilities(
const vector< UINT > &classLabels )
const;
609 static bool generateGaussDataset(
const std::string filename,
const UINT numSamples = 10000,
const UINT numClasses = 10,
const UINT numDimensions = 3,
const double range = 10,
const double sigma = 1 );
616 UINT totalNumSamples;
618 bool crossValidationSetup;
619 bool useExternalRanges;
620 bool allowNullGestureClass;
621 vector< MinMax > externalRanges;
622 vector< ClassTracker > classTracker;
623 vector< ClassificationSample > data;
624 vector< vector< UINT > > crossValidationIndexs;
629 #endif //GRT_CLASSIFICATION_DATA_HEADER
VectorDouble getStdDev() const
bool save(const string &filename) const
bool removeSample(const UINT index)
bool setAllowNullGestureClass(bool allowNullGestureClass)
VectorDouble getMean() const
bool reserve(const UINT N)
vector< UINT > getClassLabels() const
bool loadDatasetFromFile(const string &filename)
string getStatsAsString() const
UINT getNumDimensions() const
ClassificationData getTrainingFoldData(const UINT foldIndex) const
string getDatasetName() const
bool setNumDimensions(UINT numDimensions)
vector< ClassificationSample > getClassificationData() const
ClassificationData & operator=(const ClassificationData &rhs)
UINT getNumSamples() const
UINT removeClass(const UINT classLabel)
MatrixDouble getClassStdDev() const
bool merge(const ClassificationData &labelledData)
vector< ClassTracker > getClassTracker() const
UINT getNumClasses() const
The UnlabelledData class is the main data container for supporting unsupervised learning.
UINT getClassLabelIndexValue(const UINT classLabel) const
bool scale(const double minTarget, const double maxTarget)
static bool generateGaussDataset(const std::string filename, const UINT numSamples=10000, const UINT numClasses=10, const UINT numDimensions=3, const double range=10, const double sigma=1)
ClassificationSample & operator[](const UINT &i)
RegressionData reformatAsRegressionData() const
vector< UINT > getClassDataIndexes(const UINT classLabel) const
vector< UINT > getNumSamplesPerClass() const
ClassificationData(UINT numDimensions=0, string datasetName="NOT_SET", string infoText="")
bool saveDatasetToCSVFile(const string &filename) const
MatrixDouble getDataAsMatrixDouble() 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.
UnlabelledData reformatAsUnlabelledData() const
MatrixDouble getCovarianceMatrix() const
UINT getMinimumClassLabel() const
bool setExternalRanges(const vector< MinMax > &externalRanges, const bool useExternalRanges=false)
vector< MinMax > getRanges() const
UINT eraseAllSamplesWithClassLabel(const UINT classLabel)
bool enableExternalRangeScaling(const bool useExternalRanges)
vector< MatrixDouble > getHistogramData(const UINT numBins) const
bool setInfoText(string infoText)
bool loadDatasetFromCSVFile(const string &filename, const UINT classLabelColumnIndex=0)
ClassificationData getTestFoldData(const UINT foldIndex) const
string getClassNameForCorrespondingClassLabel(const UINT classLabel) const
ClassificationData partition(const UINT partitionPercentage, const bool useStratifiedSampling=false)
virtual ~ClassificationData()
bool spiltDataIntoKFolds(const UINT K, const bool useStratifiedSampling=false)
MatrixDouble getClassMean() const
bool addSample(UINT classLabel, const VectorDouble &sample)
ClassificationData getBootstrappedDataset(UINT numSamples=0) const
bool load(const string &filename)
UINT getMaximumClassLabel() const
bool saveDatasetToFile(const string &filename) const
This class stores the class label and raw data for a single labelled classification sample...
bool relabelAllSamplesWithClassLabel(const UINT oldClassLabel, const UINT newClassLabel)
bool setClassNameForCorrespondingClassLabel(string className, UINT classLabel)
string getInfoText() const
bool addClass(const UINT classLabel, const std::string className="NOT_SET")
MatrixDouble getClassHistogramData(const UINT classLabel, const UINT numBins) const
bool setDatasetName(string datasetName)
ClassificationData getClassData(const UINT classLabel) const