52 GRT::TimeSeriesClassificationData
getAllData() {
return data_; }
79 bool addSample(uint32_t label,
const GRT::MatrixDouble& sample);
84 GRT::MatrixDouble
getSample(uint32_t label, uint32_t index);
96 bool relabelSample(uint32_t label, uint32_t index, uint32_t new_label);
99 bool trimSample(uint32_t label, uint32_t index, uint32_t start,
108 bool setSampleScore(uint32_t label, uint32_t index,
double score);
113 vector<double> likelihoods);
119 inline bool save(
const std::string& filename) {
120 return data_.save(filename);
123 bool load(
const std::string& filename);
126 uint32_t num_classes_;
130 using Name = std::pair<bool, std::string>;
131 vector<vector<Name>> training_sample_names_;
132 vector<std::string> default_label_names_;
136 using Score = std::pair<bool, double>;
137 vector<vector<Score>> training_sample_scores_;
142 using ClassLikelihoods = std::pair<bool, vector<double>>;
143 vector<vector<ClassLikelihoods>> training_sample_class_likelihoods_;
151 vector<uint32_t> num_samples_per_label_;
154 GRT::TimeSeriesClassificationData data_;
uint32_t getNumLabels()
Definition: training-data-manager.h:54
bool setNameForLabel(const std::string name, uint32_t label)
This will modify the default name for this label, changing it from "Label X" to name.
Definition: training-data-manager.cpp:88
vector< double > getSampleClassLikelihoods(uint32_t label, uint32_t index)
Definition: training-data-manager.cpp:236
bool relabelSample(uint32_t label, uint32_t index, uint32_t new_label)
Relabel a sample from label to new_label.
Definition: training-data-manager.cpp:161
bool setNumDimensions(uint32_t dim)
Definition: training-data-manager.cpp:31
uint32_t getNumSampleForLabel(uint32_t label)
Definition: training-data-manager.cpp:101
uint32_t getTotalNumSamples()
Definition: training-data-manager.h:56
std::string getSampleName(uint32_t label, uint32_t index)
Format the sample name. Default label name is "Label X", and the sample name is "Label X [Y]" Default...
Definition: training-data-manager.cpp:46
bool setSampleClassLikelihoods(uint32_t label, uint32_t index, vector< double > likelihoods)
Definition: training-data-manager.cpp:248
bool setSampleScore(uint32_t label, uint32_t index, double score)
Definition: training-data-manager.cpp:218
std::string getLabelName(uint32_t label)
Definition: training-data-manager.cpp:83
bool hasSampleScore(uint32_t label, uint32_t index)
Definition: training-data-manager.cpp:198
bool setDatasetName(const std::string name)
Definition: training-data-manager.cpp:35
bool hasSampleClassLikelihoods(uint32_t label, uint32_t index)
Definition: training-data-manager.cpp:228
TrainingDataManager class encloses GRT::TimeSeriesClassificationData and improves upon by adding util...
Definition: training-data-manager.h:38
GRT::TimeSeriesClassificationData getAllData()
Definition: training-data-manager.h:52
bool load(const std::string &filename)
Definition: training-data-manager.cpp:258
bool deleteAllSamples()
Remove all samples.
Definition: training-data-manager.cpp:138
bool save(const std::string &filename)
Definition: training-data-manager.h:119
bool deleteAllSamplesWithLabel(uint32_t label)
Remove all samples.
Definition: training-data-manager.cpp:150
bool setSampleName(uint32_t, uint32_t, const std::string)
Definition: training-data-manager.cpp:58
TrainingDataManager(uint32_t num_classes)
Definition: training-data-manager.cpp:17
double getSampleScore(uint32_t label, uint32_t index)
Definition: training-data-manager.cpp:206
bool addSample(uint32_t label, const GRT::MatrixDouble &sample)
Add new sample. Returns false if the label is larger than configured number of classes.
Definition: training-data-manager.cpp:68
bool trimSample(uint32_t label, uint32_t index, uint32_t start, uint32_t end)
Trim sample. What's left will be [start, end], closed interval.
Definition: training-data-manager.cpp:174
bool deleteSample(uint32_t label, uint32_t index)
Remove sample by label and the index.
Definition: training-data-manager.cpp:108
GRT::MatrixDouble getSample(uint32_t label, uint32_t index)
Get the sample by label and index.
Definition: training-data-manager.cpp:95