![]() |
GestureRecognitionToolkit
Version: 1.0 Revision: 04-03-15
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
|
Public Types | |
enum | BaseTypes { BASE_TYPE_NOT_SET =0, CLASSIFIER, REGRESSIFIER, CLUSTERER } |
Public Member Functions | |
MLBase (void) | |
virtual | ~MLBase (void) |
bool | copyMLBaseVariables (const MLBase *mlBase) |
virtual bool | train (ClassificationData trainingData) |
virtual bool | train_ (ClassificationData &trainingData) |
virtual bool | train (RegressionData trainingData) |
virtual bool | train_ (RegressionData &trainingData) |
virtual bool | train (TimeSeriesClassificationData trainingData) |
virtual bool | train_ (TimeSeriesClassificationData &trainingData) |
virtual bool | train (TimeSeriesClassificationDataStream trainingData) |
virtual bool | train_ (TimeSeriesClassificationDataStream &trainingData) |
virtual bool | train (UnlabelledData trainingData) |
virtual bool | train_ (UnlabelledData &trainingData) |
virtual bool | train (MatrixDouble data) |
virtual bool | train_ (MatrixDouble &data) |
virtual bool | predict (VectorDouble inputVector) |
virtual bool | predict_ (VectorDouble &inputVector) |
virtual bool | predict (MatrixDouble inputMatrix) |
virtual bool | predict_ (MatrixDouble &inputMatrix) |
virtual bool | map (VectorDouble inputVector) |
virtual bool | map_ (VectorDouble &inputVector) |
virtual bool | reset () |
virtual bool | clear () |
virtual bool | print () const |
virtual bool | save (const string filename) const |
virtual bool | load (const string filename) |
virtual bool | saveModelToFile (string filename) const |
virtual bool | saveModelToFile (fstream &file) const |
virtual bool | loadModelFromFile (string filename) |
virtual bool | loadModelFromFile (fstream &file) |
virtual bool | getModel (ostream &stream) const |
double | scale (const double &x, const double &minSource, const double &maxSource, const double &minTarget, const double &maxTarget, const bool constrain=false) |
virtual string | getModelAsString () const |
UINT | getBaseType () const |
UINT | getNumInputFeatures () const |
UINT | getNumInputDimensions () const |
UINT | getNumOutputDimensions () const |
UINT | getMinNumEpochs () const |
UINT | getMaxNumEpochs () const |
UINT | getValidationSetSize () const |
UINT | getNumTrainingIterationsToConverge () const |
double | getMinChange () const |
double | getLearningRate () const |
double | getRootMeanSquaredTrainingError () const |
double | getTotalSquaredTrainingError () const |
bool | getUseValidationSet () const |
bool | getRandomiseTrainingOrder () const |
bool | getTrained () const |
bool | getModelTrained () const |
bool | getScalingEnabled () const |
bool | getIsBaseTypeClassifier () const |
bool | getIsBaseTypeRegressifier () const |
bool | getIsBaseTypeClusterer () const |
bool | enableScaling (bool useScaling) |
bool | setMaxNumEpochs (const UINT maxNumEpochs) |
bool | setMinNumEpochs (const UINT minNumEpochs) |
bool | setMinChange (const double minChange) |
bool | setLearningRate (double learningRate) |
bool | setUseValidationSet (const bool useValidationSet) |
bool | setValidationSetSize (const UINT validationSetSize) |
bool | setRandomiseTrainingOrder (const bool randomiseTrainingOrder) |
bool | registerTrainingResultsObserver (Observer< TrainingResult > &observer) |
bool | registerTestResultsObserver (Observer< TestInstanceResult > &observer) |
bool | removeTrainingResultsObserver (const Observer< TrainingResult > &observer) |
bool | removeTestResultsObserver (const Observer< TestInstanceResult > &observer) |
bool | removeAllTrainingObservers () |
bool | removeAllTestObservers () |
bool | notifyTrainingResultsObservers (const TrainingResult &data) |
bool | notifyTestResultsObservers (const TestInstanceResult &data) |
MLBase * | getMLBasePointer () |
const MLBase * | getMLBasePointer () const |
vector< TrainingResult > | getTrainingResults () const |
![]() | |
GRTBase (void) | |
virtual | ~GRTBase (void) |
bool | copyGRTBaseVariables (const GRTBase *GRTBase) |
string | getClassType () const |
string | getLastWarningMessage () const |
string | getLastErrorMessage () const |
string | getLastInfoMessage () const |
GRTBase * | getGRTBasePointer () |
const GRTBase * | getGRTBasePointer () const |
![]() | |
virtual void | notify (const TrainingResult &data) |
![]() | |
virtual void | notify (const TestInstanceResult &data) |
Protected Member Functions | |
bool | saveBaseSettingsToFile (fstream &file) const |
bool | loadBaseSettingsFromFile (fstream &file) |
![]() | |
double | SQR (const double &x) const |
Protected Attributes | |
bool | trained |
bool | useScaling |
UINT | baseType |
UINT | numInputDimensions |
UINT | numOutputDimensions |
UINT | numTrainingIterationsToConverge |
UINT | minNumEpochs |
UINT | maxNumEpochs |
UINT | validationSetSize |
double | learningRate |
double | minChange |
double | rootMeanSquaredTrainingError |
double | totalSquaredTrainingError |
bool | useValidationSet |
bool | randomiseTrainingOrder |
Random | random |
vector< TrainingResult > | trainingResults |
TrainingResultsObserverManager | trainingResultsObserverManager |
TestResultsObserverManager | testResultsObserverManager |
![]() | |
string | classType |
DebugLog | debugLog |
ErrorLog | errorLog |
InfoLog | infoLog |
TrainingLog | trainingLog |
TestingLog | testingLog |
WarningLog | warningLog |
Additional Inherited Members | |
![]() | |
static string | getGRTVersion (bool returnRevision=true) |
static string | getGRTRevison () |
GRT::MLBase::MLBase | ( | void | ) |
Default MLBase Constructor
Definition at line 25 of file MLBase.cpp.
|
virtual |
Default MLBase Destructor
Definition at line 42 of file MLBase.cpp.
|
virtual |
This is the main clear interface for all the GRT machine learning algorithms. It will completely clear the ML module, removing any trained model and setting all the base variables to their default values.
Reimplemented in GRT::SelfOrganizingMap, GRT::HierarchicalClustering, GRT::DTW, GRT::HMM, GRT::FiniteStateMachine, GRT::AdaBoost, GRT::ANBC, GRT::SVM, GRT::FFT, GRT::KNN, GRT::DecisionTree, GRT::BAG, GRT::GMM, GRT::RandomForests, GRT::RBMQuantizer, GRT::ParticleClassifier, GRT::KMeansQuantizer, GRT::SOMQuantizer, GRT::ClusterTree, GRT::RegressionTree, GRT::FIRFilter, GRT::MinDist, GRT::Softmax, GRT::SwipeDetector, GRT::Clusterer, GRT::MLP, GRT::BernoulliRBM, GRT::KMeans, GRT::FeatureExtraction, GRT::PreProcessing, GRT::GaussianMixtureModels, GRT::Regressifier, GRT::Classifier, GRT::ContinuousHiddenMarkovModel, and GRT::MovementDetector.
Definition at line 118 of file MLBase.cpp.
bool GRT::MLBase::copyMLBaseVariables | ( | const MLBase * | mlBase | ) |
This copies all the MLBase variables from the instance mlBaseA to the instance mlBaseA.
const | MLBase *mlBase: a pointer to a MLBase class from which the values will be copied to the instance that calls the function |
Definition at line 46 of file MLBase.cpp.
bool GRT::MLBase::enableScaling | ( | bool | useScaling | ) |
Sets if scaling should be used during the training and prediction phases.
Definition at line 235 of file MLBase.cpp.
UINT GRT::MLBase::getBaseType | ( | ) | const |
Gets the current ML base type.
Definition at line 184 of file MLBase.cpp.
bool GRT::MLBase::getIsBaseTypeClassifier | ( | ) | const |
Gets if the derived class type is CLASSIFIER.
Definition at line 229 of file MLBase.cpp.
bool GRT::MLBase::getIsBaseTypeClusterer | ( | ) | const |
Gets if the derived class type is CLUSTERER.
Definition at line 233 of file MLBase.cpp.
bool GRT::MLBase::getIsBaseTypeRegressifier | ( | ) | const |
Gets if the derived class type is REGRESSIFIER.
Definition at line 231 of file MLBase.cpp.
double GRT::MLBase::getLearningRate | ( | ) | const |
Gets the current learningRate value, this is value used to update the weights at each step of a learning algorithm such as stochastic gradient descent.
Definition at line 211 of file MLBase.cpp.
UINT GRT::MLBase::getMaxNumEpochs | ( | ) | const |
Gets the maximum number of epochs. This value controls the maximum number of epochs that can be used by the training algorithm. An epoch is a complete iteration of all training samples.
Definition at line 203 of file MLBase.cpp.
double GRT::MLBase::getMinChange | ( | ) | const |
Gets the minimum change value that controls when the training algorithm should stop.
UINT GRT::MLBase::getMinNumEpochs | ( | ) | const |
Gets the minimum number of epochs. This is the minimum number of epochs that can elapse with no change between two training epochs. An epoch is a complete iteration of all training samples.
Definition at line 199 of file MLBase.cpp.
MLBase * GRT::MLBase::getMLBasePointer | ( | ) |
This functions returns a pointer to the current instance.
Definition at line 322 of file MLBase.cpp.
const MLBase * GRT::MLBase::getMLBasePointer | ( | ) | const |
This functions returns a const pointer to the current instance.
Definition at line 326 of file MLBase.cpp.
|
virtual |
This function adds the current model to the formatted stream. This function should be overwritten by the derived class.
ostream | &file: a reference to the stream the model will be added to |
Reimplemented in GRT::DecisionTree.
Definition at line 174 of file MLBase.cpp.
|
virtual |
Gets the current model and settings as a string.
Definition at line 176 of file MLBase.cpp.
bool GRT::MLBase::getModelTrained | ( | ) | const |
This function is now depreciated. You should use the getTrained() function instead.
Definition at line 225 of file MLBase.cpp.
UINT GRT::MLBase::getNumInputDimensions | ( | ) | const |
Gets the number of input dimensions in trained model.
Definition at line 188 of file MLBase.cpp.
UINT GRT::MLBase::getNumInputFeatures | ( | ) | const |
Gets the number of input dimensions in trained model. This function is now depriciated and will be removed in the future, you should use getNumInputDimensions instead.
Definition at line 186 of file MLBase.cpp.
UINT GRT::MLBase::getNumOutputDimensions | ( | ) | const |
Gets the number of output dimensions in trained model.
Definition at line 190 of file MLBase.cpp.
UINT GRT::MLBase::getNumTrainingIterationsToConverge | ( | ) | const |
Gets the number of training iterations that were required for the algorithm to converge.
Definition at line 192 of file MLBase.cpp.
bool GRT::MLBase::getRandomiseTrainingOrder | ( | ) | const |
Returns true if the order of the training dataset should be randomized at each epoch of training. Randomizing the order of the training dataset stops a learning algorithm from focusing too much on the first few examples in the dataset.
double GRT::MLBase::getRootMeanSquaredTrainingError | ( | ) | const |
Gets the root mean squared error on the training data during the training phase.
Definition at line 215 of file MLBase.cpp.
bool GRT::MLBase::getScalingEnabled | ( | ) | const |
Gets if the scaling has been enabled.
Definition at line 227 of file MLBase.cpp.
double GRT::MLBase::getTotalSquaredTrainingError | ( | ) | const |
Gets the total squared error on the training data during the training phase.
Definition at line 219 of file MLBase.cpp.
bool GRT::MLBase::getTrained | ( | ) | const |
Gets if the model for the derived class has been succesfully trained.
Definition at line 223 of file MLBase.cpp.
vector< TrainingResult > GRT::MLBase::getTrainingResults | ( | ) | const |
Gets the training results from the last training phase. Each element in the vector represents the training results from 1 training iteration.
Definition at line 330 of file MLBase.cpp.
bool GRT::MLBase::getUseValidationSet | ( | ) | const |
Returns true if a validation set should be used for training. If true, then the training dataset will be partitioned into a smaller training dataset and a validation set.
The size of the partition is controlled by the validationSetSize parameter, for example, if the validationSetSize parameter is 20 then 20% of the training data will be used for a validation set leaving 80% of the original data to train the model.
UINT GRT::MLBase::getValidationSetSize | ( | ) | const |
Gets the size (as a percentage) of the validation set (if one should be used). If this value returned 20 this would mean that 20% of the training data would be set aside to create a validation set and the other 80% would be used to actually train the regression model. This will only happen if the useValidationSet parameter is set to true, otherwise 100% of the training data will be used to train the regression model.
Definition at line 207 of file MLBase.cpp.
|
virtual |
This saves the model to a file, it calls the loadModelFromFile(string filename) function unless it is overwritten by the derived class.
const | string filename: the name of the file to save the model to |
Definition at line 153 of file MLBase.cpp.
|
protected |
Loads the core base settings from a file.
Definition at line 357 of file MLBase.cpp.
|
virtual |
This loads a trained model from a file, it calls the loadModelFromFile(fstream &file) function unless it is overwritten by the derived class.
string | filename: the name of the file to load the model from |
Reimplemented in GRT::ClassLabelTimeoutFilter, GRT::FIRFilter, GRT::ClassLabelFilter, GRT::LowPassFilter, GRT::HighPassFilter, GRT::RBMQuantizer, GRT::Derivative, GRT::SOMQuantizer, GRT::ZeroCrossingCounter, GRT::SavitzkyGolayFilter, GRT::DeadZone, GRT::ClassLabelChangeFilter, GRT::DoubleMovingAverageFilter, GRT::MedianFilter, GRT::MovingAverageFilter, GRT::MovementTrajectoryFeatures, GRT::FFTFeatures, GRT::KMeansFeatures, GRT::MovementIndex, GRT::TimeseriesBuffer, GRT::PreProcessing, GRT::TimeDomainFeatures, and GRT::PostProcessing.
Definition at line 157 of file MLBase.cpp.
|
virtual |
This loads a trained model from a file. This function should be overwritten by the derived class.
fstream | &file: a reference to the file the model will be loaded from |
Reimplemented in GRT::SelfOrganizingMap, GRT::HierarchicalClustering, GRT::DTW, GRT::ClassLabelTimeoutFilter, GRT::HMM, GRT::FiniteStateMachine, GRT::KMeans, GRT::FFT, GRT::RBMQuantizer, GRT::LDA, GRT::ZeroCrossingCounter, GRT::FIRFilter, GRT::AdaBoost, GRT::SOMQuantizer, GRT::DecisionTree, GRT::ClassLabelFilter, GRT::ANBC, GRT::SVM, GRT::KNN, GRT::LowPassFilter, GRT::HighPassFilter, GRT::RandomForests, GRT::Derivative, GRT::MovementTrajectoryFeatures, GRT::SavitzkyGolayFilter, GRT::ClusterTree, GRT::FFTFeatures, GRT::RegressionTree, GRT::KMeansFeatures, GRT::DeadZone, GRT::BAG, GRT::GaussianMixtureModels, GRT::MovementIndex, GRT::ClassLabelChangeFilter, GRT::DoubleMovingAverageFilter, GRT::SwipeDetector, GRT::MedianFilter, GRT::MovingAverageFilter, GRT::MLP, GRT::GMM, GRT::KMeansQuantizer, GRT::TimeseriesBuffer, GRT::MinDist, GRT::Softmax, GRT::PreProcessing, GRT::TimeDomainFeatures, GRT::BernoulliRBM, GRT::PostProcessing, GRT::MultidimensionalRegression, GRT::LeakyIntegrator, GRT::FeatureExtraction, GRT::LinearRegression, GRT::LogisticRegression, GRT::ParticleClassifier, GRT::DiscreteHiddenMarkovModel, GRT::ContinuousHiddenMarkovModel, and GRT::MovementDetector.
Definition at line 172 of file MLBase.cpp.
|
virtual |
This is the main mapping interface for all the GRT machine learning algorithms. By defaut it will call the map_ function, unless it is overwritten by the derived class.
VectorDouble | inputVector: the input vector for mapping/regression |
Definition at line 112 of file MLBase.cpp.
|
virtual |
This is the main mapping interface by reference for all the GRT machine learning algorithms. This should be overwritten by the derived class.
VectorDouble | &inputVector: a reference to the input vector for mapping/regression |
Reimplemented in GRT::SelfOrganizingMap.
Definition at line 114 of file MLBase.cpp.
bool GRT::MLBase::notifyTestResultsObservers | ( | const TestInstanceResult & | data | ) |
Notifies all observers that have subscribed to the test results observer manager.
Definition at line 318 of file MLBase.cpp.
bool GRT::MLBase::notifyTrainingResultsObservers | ( | const TrainingResult & | data | ) |
Notifies all observers that have subscribed to the training results observer manager.
Definition at line 314 of file MLBase.cpp.
|
virtual |
This is the main prediction interface for all the GRT machine learning algorithms. By defaut it will call the predict_ function, unless it is overwritten by the derived class.
VectorDouble | inputVector: the new input vector for prediction |
Reimplemented in GRT::LDA.
Definition at line 104 of file MLBase.cpp.
|
virtual |
This is the prediction interface for time series data. By defaut it will call the predict_ function, unless it is overwritten by the derived class.
MatrixDouble | inputMatrix: the new input matrix for prediction |
Definition at line 108 of file MLBase.cpp.
|
virtual |
This is the main prediction interface for all the GRT machine learning algorithms. This should be overwritten by the derived class.
VectorDouble | &inputVector: a reference to the input vector for prediction |
Reimplemented in GRT::DTW, GRT::KMeans, GRT::AdaBoost, GRT::HMM, GRT::SVM, GRT::GaussianMixtureModels, GRT::KNN, GRT::FiniteStateMachine, GRT::DecisionTree, GRT::ANBC, GRT::RandomForests, GRT::GMM, GRT::ClusterTree, GRT::RegressionTree, GRT::BAG, GRT::MinDist, GRT::Softmax, GRT::SwipeDetector, GRT::MLP, GRT::MultidimensionalRegression, GRT::LinearRegression, GRT::LogisticRegression, GRT::ParticleClassifier, GRT::BernoulliRBM, GRT::ContinuousHiddenMarkovModel, and GRT::MovementDetector.
Definition at line 106 of file MLBase.cpp.
|
virtual |
This is the prediction interface for time series data. This should be overwritten by the derived class.
MatrixDouble | inputMatrix: a reference to the new input matrix for prediction |
Reimplemented in GRT::DTW, GRT::HMM, and GRT::ContinuousHiddenMarkovModel.
Definition at line 110 of file MLBase.cpp.
|
virtual |
This is the main print interface for all the GRT machine learning algorithms. This should be overwritten by the derived class. It will print the model and settings to the display log.
Reimplemented in GRT::HMM, GRT::FiniteStateMachine, GRT::BernoulliRBM, GRT::RandomForests, GRT::ClusterTree, GRT::RegressionTree, GRT::MLP, GRT::DiscreteHiddenMarkovModel, and GRT::ContinuousHiddenMarkovModel.
Definition at line 129 of file MLBase.cpp.
bool GRT::MLBase::registerTestResultsObserver | ( | Observer< TestInstanceResult > & | observer | ) |
Registers the observer with the test result observer manager. The observer will then be notified when any new test result is computed.
Definition at line 294 of file MLBase.cpp.
bool GRT::MLBase::registerTrainingResultsObserver | ( | Observer< TrainingResult > & | observer | ) |
Registers the observer with the training result observer manager. The observer will then be notified when any new training result is computed.
Definition at line 290 of file MLBase.cpp.
bool GRT::MLBase::removeAllTestObservers | ( | ) |
Removes all observers from the training result observer manager.
Definition at line 310 of file MLBase.cpp.
bool GRT::MLBase::removeAllTrainingObservers | ( | ) |
Removes all observers from the training result observer manager.
Definition at line 306 of file MLBase.cpp.
bool GRT::MLBase::removeTestResultsObserver | ( | const Observer< TestInstanceResult > & | observer | ) |
Removes the observer from the test result observer manager.
Definition at line 302 of file MLBase.cpp.
bool GRT::MLBase::removeTrainingResultsObserver | ( | const Observer< TrainingResult > & | observer | ) |
Removes the observer from the training result observer manager.
Definition at line 298 of file MLBase.cpp.
|
virtual |
This is the main reset interface for all the GRT machine learning algorithms. It should be used to reset the model (i.e. set all values back to default settings). If you want to completely clear the model (i.e. clear any learned weights or values) then you should use the clear function.
Reimplemented in GRT::SelfOrganizingMap, GRT::HierarchicalClustering, GRT::DTW, GRT::ClassLabelTimeoutFilter, GRT::HMM, GRT::FFT, GRT::FiniteStateMachine, GRT::ParticleClassifier, GRT::ANBC, GRT::SwipeDetector, GRT::ZeroCrossingCounter, GRT::BAG, GRT::ClassLabelFilter, GRT::RBMQuantizer, GRT::KMeansQuantizer, GRT::SOMQuantizer, GRT::LowPassFilter, GRT::MovementTrajectoryFeatures, GRT::HighPassFilter, GRT::FFTFeatures, GRT::Derivative, GRT::FIRFilter, GRT::SavitzkyGolayFilter, GRT::Clusterer, GRT::KMeansFeatures, GRT::MovementIndex, GRT::DeadZone, GRT::ClassLabelChangeFilter, GRT::DoubleMovingAverageFilter, GRT::BernoulliRBM, GRT::MedianFilter, GRT::MovingAverageFilter, GRT::TimeseriesBuffer, GRT::LeakyIntegrator, GRT::TimeDomainFeatures, GRT::Context, GRT::KMeans, GRT::FeatureExtraction, GRT::PostProcessing, GRT::GaussianMixtureModels, GRT::PreProcessing, GRT::Regressifier, GRT::Classifier, GRT::DiscreteHiddenMarkovModel, GRT::ContinuousHiddenMarkovModel, GRT::MovementDetector, and GRT::Gate.
Definition at line 116 of file MLBase.cpp.
|
virtual |
This saves the model to a file, it calls the saveModelToFile(string filename) function unless it is overwritten by the derived class.
const | string filename: the name of the file to save the model to |
Definition at line 131 of file MLBase.cpp.
|
protected |
Saves the core base settings to a file.
Definition at line 334 of file MLBase.cpp.
|
virtual |
This saves the trained model to a file, it calls the saveModelToFile(fstream &file) function unless it is overwritten by the derived class.
string | filename: the name of the file to save the model to |
Reimplemented in GRT::ClassLabelTimeoutFilter, GRT::RBMQuantizer, GRT::SOMQuantizer, GRT::ZeroCrossingCounter, GRT::FIRFilter, GRT::ClassLabelFilter, GRT::LowPassFilter, GRT::HighPassFilter, GRT::MovementTrajectoryFeatures, GRT::Derivative, GRT::FFTFeatures, GRT::SavitzkyGolayFilter, GRT::KMeansFeatures, GRT::MovementIndex, GRT::DeadZone, GRT::ClassLabelChangeFilter, GRT::DoubleMovingAverageFilter, GRT::MedianFilter, GRT::MovingAverageFilter, GRT::TimeseriesBuffer, GRT::TimeDomainFeatures, GRT::PreProcessing, and GRT::PostProcessing.
Definition at line 135 of file MLBase.cpp.
|
virtual |
This saves the trained model to a file. This function should be overwritten by the derived class.
fstream | &file: a reference to the file the model will be saved to |
Reimplemented in GRT::SelfOrganizingMap, GRT::HierarchicalClustering, GRT::DTW, GRT::ClassLabelTimeoutFilter, GRT::HMM, GRT::FiniteStateMachine, GRT::KMeans, GRT::FFT, GRT::RBMQuantizer, GRT::LDA, GRT::ZeroCrossingCounter, GRT::AdaBoost, GRT::SOMQuantizer, GRT::DecisionTree, GRT::ANBC, GRT::SVM, GRT::KNN, GRT::RandomForests, GRT::MovementTrajectoryFeatures, GRT::FIRFilter, GRT::ClusterTree, GRT::FFTFeatures, GRT::RegressionTree, GRT::KMeansFeatures, GRT::BAG, GRT::GaussianMixtureModels, GRT::MovementIndex, GRT::ClassLabelFilter, GRT::SwipeDetector, GRT::MLP, GRT::GMM, GRT::KMeansQuantizer, GRT::LowPassFilter, GRT::HighPassFilter, GRT::TimeseriesBuffer, GRT::Derivative, GRT::SavitzkyGolayFilter, GRT::MinDist, GRT::Softmax, GRT::PreProcessing, GRT::TimeDomainFeatures, GRT::DeadZone, GRT::ClassLabelChangeFilter, GRT::DoubleMovingAverageFilter, GRT::MedianFilter, GRT::MovingAverageFilter, GRT::BernoulliRBM, GRT::PostProcessing, GRT::MultidimensionalRegression, GRT::LeakyIntegrator, GRT::FeatureExtraction, GRT::LinearRegression, GRT::LogisticRegression, GRT::ParticleClassifier, GRT::DiscreteHiddenMarkovModel, GRT::ContinuousHiddenMarkovModel, and GRT::MovementDetector.
Definition at line 151 of file MLBase.cpp.
|
inline |
Scales the input value x (which should be in the range [minSource maxSource]) to a value in the new target range of [minTarget maxTarget].
const | double &x: the value that should be scaled |
const | double &minSource: the minimum range that x originates from |
const | double &maxSource: the maximum range that x originates from |
const | double &minTarget: the minimum range that x should be scaled to |
const | double &maxTarget: the maximum range that x should be scaled to |
const | bool constrain: sets if the scaled value should be constrained to the target range |
bool GRT::MLBase::setLearningRate | ( | double | learningRate | ) |
Sets the learningRate. This is used to update the weights at each step of learning algorithms such as stochastic gradient descent. The learningRate value must be greater than zero.
double | learningRate: the learningRate value used during the training phase, must be greater than zero |
Definition at line 260 of file MLBase.cpp.
bool GRT::MLBase::setMaxNumEpochs | ( | const UINT | maxNumEpochs | ) |
Sets the maximum number of epochs (a complete iteration of all training samples) that can be run during the training phase. The maxNumIterations value must be greater than zero.
const | UINT maxNumIterations: the maximum number of iterations value, must be greater than zero |
Definition at line 237 of file MLBase.cpp.
bool GRT::MLBase::setMinChange | ( | const double | minChange | ) |
Sets the minimum change that must be achieved between two training epochs for the training to continue. The minChange value must be greater than zero.
const | double minChange: the minimum change value, must be greater than zero |
Definition at line 251 of file MLBase.cpp.
bool GRT::MLBase::setMinNumEpochs | ( | const UINT | minNumEpochs | ) |
Sets the minimum number of epochs (a complete iteration of all training samples) that can elapse with no change between two training epochs.
const | UINT minNumEpochs: the minimum number of epochs that can elapse with no change between two training epochs |
Definition at line 246 of file MLBase.cpp.
bool GRT::MLBase::setRandomiseTrainingOrder | ( | const bool | randomiseTrainingOrder | ) |
Sets if the order of the training dataset should be randomized at each epoch of training. Randomizing the order of the training dataset stops a learning algorithm from focusing too much on the first few examples in the dataset.
Definition at line 285 of file MLBase.cpp.
bool GRT::MLBase::setUseValidationSet | ( | const bool | useValidationSet | ) |
Sets the size of the validation set used by some learning algorithms for training. This value represents the percentage of the main dataset that will be used for training. For example, if the validationSetSize parameter is 20 then 20% of the training data will be used for a validation set leaving 80% of the original data to train the model.
const | UINT validationSetSize: the new validation set size (as a percentage) |
Definition at line 280 of file MLBase.cpp.
bool GRT::MLBase::setValidationSetSize | ( | const UINT | validationSetSize | ) |
Sets the size of the validation set used by some learning algorithms for training. This value represents the percentage of the main dataset that will be used for training. For example, if the validationSetSize parameter is 20 then 20% of the training data will be used for a validation set leaving 80% of the original data to train the model.
const | UINT validationSetSize: the new validation set size (as a percentage) |
Definition at line 268 of file MLBase.cpp.
|
virtual |
This is the main training interface for ClassificationData. By default it will call the train_ function, unless it is overwritten by the derived class.
ClassificationData | trainingData: the training data that will be used to train the ML model |
Reimplemented in GRT::LDA, and GRT::HMM.
Definition at line 80 of file MLBase.cpp.
|
virtual |
This is the main training interface for regression data. By default it will call the train_ function, unless it is overwritten by the derived class.
RegressionData | trainingData: the training data that will be used to train a new regression model |
Definition at line 84 of file MLBase.cpp.
|
virtual |
This is the main training interface for TimeSeriesClassificationData. By default it will call the train_ function, unless it is overwritten by the derived class.
TimeSeriesClassificationData | trainingData: the training data that will be used to train the ML model |
Definition at line 88 of file MLBase.cpp.
|
virtual |
This is the main training interface for TimeSeriesClassificationDataStream. By default it will call the train_ function, unless it is overwritten by the derived class.
TimeSeriesClassificationDataStream | trainingData: the training data that will be used to train the ML model |
Definition at line 92 of file MLBase.cpp.
|
virtual |
This is the main training interface for UnlabelledData. By default it will call the train_ function, unless it is overwritten by the derived class.
UnlabelledData | trainingData: the training data that will be used to train the ML model |
Definition at line 96 of file MLBase.cpp.
|
virtual |
This is the main training interface for MatrixDouble data. By default it will call the train_ function, unless it is overwritten by the derived class.
MatrixDouble | trainingData: the training data that will be used to train the ML model |
Definition at line 100 of file MLBase.cpp.
|
virtual |
This is the main training interface for referenced ClassificationData. This should be overwritten by the derived class.
ClassificationData | &trainingData: a reference to the training data that will be used to train the ML model |
Reimplemented in GRT::SelfOrganizingMap, GRT::HierarchicalClustering, GRT::RBMQuantizer, GRT::SOMQuantizer, GRT::KMeansFeatures, GRT::KMeansQuantizer, GRT::KMeans, GRT::AdaBoost, GRT::SVM, GRT::KNN, GRT::GaussianMixtureModels, GRT::DecisionTree, GRT::ANBC, GRT::RandomForests, GRT::GMM, GRT::BAG, GRT::MinDist, GRT::Softmax, GRT::SwipeDetector, GRT::FiniteStateMachine, GRT::Clusterer, and GRT::MLP.
Definition at line 82 of file MLBase.cpp.
|
virtual |
This is the main training interface for all the regression algorithms. This should be overwritten by the derived class.
RegressionData | trainingData: the training data that will be used to train a new regression model |
Reimplemented in GRT::RegressionTree, GRT::MLP, GRT::MultidimensionalRegression, GRT::LinearRegression, and GRT::LogisticRegression.
Definition at line 86 of file MLBase.cpp.
|
virtual |
This is the main training interface for referenced TimeSeriesClassificationData. This should be overwritten by the derived class.
TimeSeriesClassificationData | &trainingData: a reference to the training data that will be used to train the ML model |
Reimplemented in GRT::RBMQuantizer, GRT::SOMQuantizer, GRT::KMeansFeatures, GRT::DTW, GRT::KMeansQuantizer, GRT::HMM, GRT::FiniteStateMachine, and GRT::ParticleClassifier.
Definition at line 90 of file MLBase.cpp.
|
virtual |
This is the main training interface for referenced TimeSeriesClassificationDataStream. This should be overwritten by the derived class.
TimeSeriesClassificationDataStream | &trainingData: a reference to the training data that will be used to train the ML model |
Reimplemented in GRT::RBMQuantizer, GRT::SOMQuantizer, GRT::KMeansFeatures, GRT::KMeansQuantizer, and GRT::FiniteStateMachine.
Definition at line 94 of file MLBase.cpp.
|
virtual |
This is the main training interface for referenced UnlabelledData. This should be overwritten by the derived class.
UnlabelledData | &trainingData: a reference to the training data that will be used to train the ML model |
Reimplemented in GRT::SelfOrganizingMap, GRT::HierarchicalClustering, GRT::RBMQuantizer, GRT::SOMQuantizer, GRT::KMeansFeatures, GRT::KMeansQuantizer, GRT::KMeans, GRT::GaussianMixtureModels, and GRT::Clusterer.
Definition at line 98 of file MLBase.cpp.
|
virtual |
This is the main training interface for referenced MatrixDouble data. This should be overwritten by the derived class.
MatrixDouble | &trainingData: a reference to the training data that will be used to train the ML model |
Reimplemented in GRT::SelfOrganizingMap, GRT::HierarchicalClustering, GRT::RBMQuantizer, GRT::SOMQuantizer, GRT::KMeansFeatures, GRT::KMeansQuantizer, GRT::KMeans, GRT::GaussianMixtureModels, GRT::ClusterTree, GRT::BernoulliRBM, and GRT::Clusterer.
Definition at line 102 of file MLBase.cpp.