GestureRecognitionToolkit
Version: 0.1.0
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 (ClassificationDataStream trainingData) |
virtual bool | train_ (ClassificationDataStream &trainingData) |
virtual bool | train (UnlabelledData trainingData) |
virtual bool | train_ (UnlabelledData &trainingData) |
virtual bool | train (MatrixFloat data) |
virtual bool | train_ (MatrixFloat &data) |
virtual bool | predict (VectorFloat inputVector) |
virtual bool | predict_ (VectorFloat &inputVector) |
virtual bool | predict (MatrixFloat inputMatrix) |
virtual bool | predict_ (MatrixFloat &inputMatrix) |
virtual bool | map (VectorFloat inputVector) |
virtual bool | map_ (VectorFloat &inputVector) |
virtual bool | reset () |
virtual bool | clear () |
virtual bool | print () const |
virtual bool | save (const std::string filename) const |
virtual bool | load (const std::string filename) |
virtual bool | saveModelToFile (std::string filename) const |
virtual bool | saveModelToFile (std::fstream &file) const |
virtual bool | loadModelFromFile (std::string filename) |
virtual bool | loadModelFromFile (std::fstream &file) |
virtual bool | getModel (std::ostream &stream) const |
Float | scale (const Float &x, const Float &minSource, const Float &maxSource, const Float &minTarget, const Float &maxTarget, const bool constrain=false) |
virtual std::string | getModelAsString () const |
DataType | getInputType () const |
DataType | getOutputType () 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 |
Float | getMinChange () const |
Float | getLearningRate () const |
Float | getRootMeanSquaredTrainingError () const |
Float | getTotalSquaredTrainingError () const |
Float | getValidationSetAccuracy () const |
VectorFloat | getValidationSetPrecision () const |
VectorFloat | getValidationSetRecall () 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 (const bool useScaling) |
bool | setMaxNumEpochs (const UINT maxNumEpochs) |
bool | setMinNumEpochs (const UINT minNumEpochs) |
bool | setMinChange (const Float minChange) |
bool | setLearningRate (const Float learningRate) |
bool | setUseValidationSet (const bool useValidationSet) |
bool | setValidationSetSize (const UINT validationSetSize) |
bool | setRandomiseTrainingOrder (const bool randomiseTrainingOrder) |
bool | setTrainingLoggingEnabled (const bool loggingEnabled) |
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 |
Public Member Functions inherited from GRTBase | |
GRTBase (void) | |
virtual | ~GRTBase (void) |
bool | copyGRTBaseVariables (const GRTBase *GRTBase) |
std::string | getClassType () const |
std::string | getLastWarningMessage () const |
std::string | getLastErrorMessage () const |
std::string | getLastInfoMessage () const |
bool | setInfoLoggingEnabled (const bool loggingEnabled) |
bool | setWarningLoggingEnabled (const bool loggingEnabled) |
bool | setErrorLoggingEnabled (const bool loggingEnabled) |
GRTBase * | getGRTBasePointer () |
const GRTBase * | getGRTBasePointer () const |
Public Member Functions inherited from Observer< TrainingResult > | |
virtual void | notify (const TrainingResult &data) |
Public Member Functions inherited from Observer< TestInstanceResult > | |
virtual void | notify (const TestInstanceResult &data) |
Protected Member Functions | |
bool | saveBaseSettingsToFile (std::fstream &file) const |
bool | loadBaseSettingsFromFile (std::fstream &file) |
Protected Member Functions inherited from GRTBase | |
Float | SQR (const Float &x) const |
Protected Attributes | |
bool | trained |
bool | useScaling |
DataType | inputType |
DataType | outputType |
UINT | baseType |
UINT | numInputDimensions |
UINT | numOutputDimensions |
UINT | numTrainingIterationsToConverge |
UINT | minNumEpochs |
UINT | maxNumEpochs |
UINT | validationSetSize |
Float | learningRate |
Float | minChange |
Float | rootMeanSquaredTrainingError |
Float | totalSquaredTrainingError |
Float | validationSetAccuracy |
bool | useValidationSet |
bool | randomiseTrainingOrder |
VectorFloat | validationSetPrecision |
VectorFloat | validationSetRecall |
Random | random |
std::vector< TrainingResult > | trainingResults |
TrainingResultsObserverManager | trainingResultsObserverManager |
TestResultsObserverManager | testResultsObserverManager |
Protected Attributes inherited from GRTBase | |
std::string | classType |
DebugLog | debugLog |
ErrorLog | errorLog |
InfoLog | infoLog |
TrainingLog | trainingLog |
TestingLog | testingLog |
WarningLog | warningLog |
Additional Inherited Members | |
Static Public Member Functions inherited from GRTBase | |
static std::string | getGRTVersion (bool returnRevision=true) |
static std::string | getGRTRevison () |
GRT_BEGIN_NAMESPACE MLBase::MLBase | ( | void | ) |
Default MLBase Constructor
GRT MIT License Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition at line 25 of file MLBase.cpp.
|
virtual |
Default MLBase Destructor
Definition at line 45 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 SelfOrganizingMap, HierarchicalClustering, DTW, HMM, FFT, FiniteStateMachine, AdaBoost, ANBC, SVM, KNN, RandomForests, DecisionTree, BAG, GMM, RBMQuantizer, ParticleClassifier, KMeansQuantizer, SOMQuantizer, ClusterTree, RegressionTree, FIRFilter, MinDist, Softmax, MLP, SwipeDetector, Clusterer, BernoulliRBM, FeatureExtraction, KMeans, PreProcessing, GaussianMixtureModels, Regressifier, Classifier, ContinuousHiddenMarkovModel, and MovementDetector.
Definition at line 126 of file MLBase.cpp.
bool MLBase::copyMLBaseVariables | ( | const MLBase * | mlBase | ) |
This copies all the MLBase variables from the instance mlBaseA to the instance mlBaseA.
mlBase | a pointer to a MLBase class from which the values will be copied to the instance that calls the function |
Definition at line 49 of file MLBase.cpp.
bool MLBase::enableScaling | ( | const bool | useScaling | ) |
Sets if scaling should be used during the training and prediction phases.
Definition at line 266 of file MLBase.cpp.
UINT MLBase::getBaseType | ( | ) | const |
Gets the current ML base type.
Definition at line 203 of file MLBase.cpp.
DataType MLBase::getInputType | ( | ) | const |
Gets the expected input data type for the module
Definition at line 195 of file MLBase.cpp.
bool MLBase::getIsBaseTypeClassifier | ( | ) | const |
Gets if the derived class type is CLASSIFIER.
Definition at line 260 of file MLBase.cpp.
bool MLBase::getIsBaseTypeClusterer | ( | ) | const |
Gets if the derived class type is CLUSTERER.
Definition at line 264 of file MLBase.cpp.
bool MLBase::getIsBaseTypeRegressifier | ( | ) | const |
Gets if the derived class type is REGRESSIFIER.
Definition at line 262 of file MLBase.cpp.
Float 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 230 of file MLBase.cpp.
UINT 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 222 of file MLBase.cpp.
Float MLBase::getMinChange | ( | ) | const |
Gets the minimum change value that controls when the training algorithm should stop.
UINT 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 218 of file MLBase.cpp.
MLBase * MLBase::getMLBasePointer | ( | ) |
This functions returns a pointer to the current instance.
Definition at line 358 of file MLBase.cpp.
const MLBase * MLBase::getMLBasePointer | ( | ) | const |
This functions returns a const pointer to the current instance.
Definition at line 362 of file MLBase.cpp.
|
virtual |
This function adds the current model to the formatted stream. This function should be overwritten by the derived class.
file | a reference to the stream the model will be added to |
Reimplemented in DecisionTree.
Definition at line 185 of file MLBase.cpp.
|
virtual |
Gets the current model and settings as a std::string.
Definition at line 187 of file MLBase.cpp.
bool MLBase::getModelTrained | ( | ) | const |
This function is now depreciated. You should use the getTrained() function instead.
Definition at line 256 of file MLBase.cpp.
UINT MLBase::getNumInputDimensions | ( | ) | const |
Gets the number of input dimensions in trained model.
Definition at line 207 of file MLBase.cpp.
UINT 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 205 of file MLBase.cpp.
UINT MLBase::getNumOutputDimensions | ( | ) | const |
Gets the number of output dimensions in trained model.
Definition at line 209 of file MLBase.cpp.
UINT MLBase::getNumTrainingIterationsToConverge | ( | ) | const |
Gets the number of training iterations that were required for the algorithm to converge.
Definition at line 211 of file MLBase.cpp.
DataType MLBase::getOutputType | ( | ) | const |
Gets the expected output data type for the module
Definition at line 199 of file MLBase.cpp.
bool 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.
Float MLBase::getRootMeanSquaredTrainingError | ( | ) | const |
Gets the root mean squared error on the training data during the training phase.
Definition at line 234 of file MLBase.cpp.
bool MLBase::getScalingEnabled | ( | ) | const |
Gets if the scaling has been enabled.
Definition at line 258 of file MLBase.cpp.
Float MLBase::getTotalSquaredTrainingError | ( | ) | const |
Gets the total squared error on the training data during the training phase.
Definition at line 238 of file MLBase.cpp.
bool MLBase::getTrained | ( | ) | const |
Gets if the model for the derived class has been succesfully trained.
Definition at line 254 of file MLBase.cpp.
Vector< TrainingResult > 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 366 of file MLBase.cpp.
bool 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.
Float MLBase::getValidationSetAccuracy | ( | ) | const |
Gets the accuracy of the validation set on the trained model, only valid if the model was trained with useValidationSet=true.
Definition at line 242 of file MLBase.cpp.
VectorFloat MLBase::getValidationSetPrecision | ( | ) | const |
Gets the precision of the validation set on the trained model, only valid if the model was trained with useValidationSet=true.
Definition at line 246 of file MLBase.cpp.
VectorFloat MLBase::getValidationSetRecall | ( | ) | const |
Gets the recall of the validation set on the trained model, only valid if the model was trained with useValidationSet=true.
Definition at line 250 of file MLBase.cpp.
UINT 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 226 of file MLBase.cpp.
|
virtual |
This saves the model to a file, it calls the loadModelFromFile(std::string filename) function unless it is overwritten by the derived class.
filename | the name of the file to save the model to |
Definition at line 164 of file MLBase.cpp.
|
protected |
Loads the core base settings from a file.
Definition at line 393 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.
filename | the name of the file to load the model from |
Reimplemented in ClassLabelTimeoutFilter, FIRFilter, ClassLabelFilter, LowPassFilter, HighPassFilter, RBMQuantizer, Derivative, SOMQuantizer, ZeroCrossingCounter, SavitzkyGolayFilter, DeadZone, ClassLabelChangeFilter, DoubleMovingAverageFilter, MedianFilter, MovingAverageFilter, MovementTrajectoryFeatures, FFTFeatures, KMeansFeatures, MovementIndex, TimeseriesBuffer, PreProcessing, TimeDomainFeatures, and PostProcessing.
Definition at line 168 of file MLBase.cpp.
|
virtual |
This loads a trained model from a file. This function should be overwritten by the derived class.
file | a reference to the file the model will be loaded from |
Reimplemented in SelfOrganizingMap, HierarchicalClustering, DTW, ClassLabelTimeoutFilter, HMM, FFT, FiniteStateMachine, KMeans, RBMQuantizer, LDA, RandomForests, ZeroCrossingCounter, FIRFilter, AdaBoost, SOMQuantizer, DecisionTree, ClassLabelFilter, ANBC, SVM, KNN, LowPassFilter, HighPassFilter, Derivative, MovementTrajectoryFeatures, SavitzkyGolayFilter, ClusterTree, FFTFeatures, RegressionTree, KMeansFeatures, DeadZone, BAG, GaussianMixtureModels, MovementIndex, ClassLabelChangeFilter, DoubleMovingAverageFilter, MLP, SwipeDetector, MedianFilter, MovingAverageFilter, GMM, KMeansQuantizer, PrincipalComponentAnalysis, TimeseriesBuffer, MinDist, Softmax, PreProcessing, TimeDomainFeatures, BernoulliRBM, PostProcessing, FeatureExtraction, MultidimensionalRegression, WeightedAverageFilter, LeakyIntegrator, LinearRegression, LogisticRegression, ParticleClassifier, DiscreteHiddenMarkovModel, ContinuousHiddenMarkovModel, and MovementDetector.
Definition at line 183 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.
inputVector | the input vector for mapping/regression |
Definition at line 120 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.
inputVector | a reference to the input vector for mapping/regression |
Reimplemented in SelfOrganizingMap.
Definition at line 122 of file MLBase.cpp.
bool MLBase::notifyTestResultsObservers | ( | const TestInstanceResult & | data | ) |
Notifies all observers that have subscribed to the test results observer manager.
data | stores the test results data for the current update |
Definition at line 354 of file MLBase.cpp.
bool MLBase::notifyTrainingResultsObservers | ( | const TrainingResult & | data | ) |
Notifies all observers that have subscribed to the training results observer manager.
data | stores the training results data for the current update |
Definition at line 350 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.
inputVector | the new input vector for prediction |
Reimplemented in LDA.
Definition at line 112 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.
inputMatrix | the new input matrix for prediction |
Definition at line 116 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.
inputVector | a reference to the input vector for prediction |
Reimplemented in DTW, KMeans, AdaBoost, HMM, SVM, GaussianMixtureModels, KNN, RandomForests, FiniteStateMachine, DecisionTree, ANBC, GMM, ClusterTree, RegressionTree, MLP, BAG, MinDist, Softmax, SwipeDetector, MultidimensionalRegression, LinearRegression, LogisticRegression, ParticleClassifier, BernoulliRBM, ContinuousHiddenMarkovModel, and MovementDetector.
Definition at line 114 of file MLBase.cpp.
|
virtual |
This is the prediction interface for time series data. This should be overwritten by the derived class.
inputMatrix | a reference to the new input matrix for prediction |
Reimplemented in DTW, HMM, and ContinuousHiddenMarkovModel.
Definition at line 118 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 HMM, FiniteStateMachine, RandomForests, BernoulliRBM, ClusterTree, RegressionTree, MLP, DiscreteHiddenMarkovModel, and ContinuousHiddenMarkovModel.
Definition at line 140 of file MLBase.cpp.
bool 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.
observer | the observer you want to register with the learning algorithm |
Definition at line 330 of file MLBase.cpp.
bool 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.
observer | the observer you want to register with the learning algorithm |
Definition at line 326 of file MLBase.cpp.
bool MLBase::removeAllTestObservers | ( | ) |
Removes all observers from the training result observer manager.
Definition at line 346 of file MLBase.cpp.
bool MLBase::removeAllTrainingObservers | ( | ) |
Removes all observers from the training result observer manager.
Definition at line 342 of file MLBase.cpp.
bool MLBase::removeTestResultsObserver | ( | const Observer< TestInstanceResult > & | observer | ) |
Removes the observer from the test result observer manager.
observer | the observer you want to remove from the learning algorithm |
Definition at line 338 of file MLBase.cpp.
bool MLBase::removeTrainingResultsObserver | ( | const Observer< TrainingResult > & | observer | ) |
Removes the observer from the training result observer manager.
observer | the observer you want to remove from the learning algorithm |
Definition at line 334 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 SelfOrganizingMap, HierarchicalClustering, DTW, ClassLabelTimeoutFilter, FFT, HMM, FiniteStateMachine, ParticleClassifier, ANBC, SwipeDetector, ZeroCrossingCounter, BAG, ClassLabelFilter, RBMQuantizer, KMeansQuantizer, SOMQuantizer, LowPassFilter, MovementTrajectoryFeatures, HighPassFilter, FFTFeatures, Derivative, FIRFilter, SavitzkyGolayFilter, Clusterer, KMeansFeatures, MovementIndex, DeadZone, BernoulliRBM, ClassLabelChangeFilter, DoubleMovingAverageFilter, MedianFilter, MovingAverageFilter, WeightedAverageFilter, TimeseriesBuffer, LeakyIntegrator, FeatureExtraction, TimeDomainFeatures, Context, KMeans, PostProcessing, GaussianMixtureModels, PreProcessing, Regressifier, Classifier, DiscreteHiddenMarkovModel, ContinuousHiddenMarkovModel, MovementDetector, and Gate.
Definition at line 124 of file MLBase.cpp.
|
virtual |
This saves the model to a file, it calls the saveModelToFile(std::string filename) function unless it is overwritten by the derived class.
filename | the name of the file to save the model to |
Definition at line 142 of file MLBase.cpp.
|
protected |
Saves the core base settings to a file.
Definition at line 370 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.
the | name of the file to save the model to |
Reimplemented in ClassLabelTimeoutFilter, RBMQuantizer, SOMQuantizer, ZeroCrossingCounter, FIRFilter, ClassLabelFilter, LowPassFilter, HighPassFilter, MovementTrajectoryFeatures, Derivative, FFTFeatures, SavitzkyGolayFilter, KMeansFeatures, MovementIndex, DeadZone, ClassLabelChangeFilter, DoubleMovingAverageFilter, MedianFilter, MovingAverageFilter, TimeseriesBuffer, TimeDomainFeatures, PreProcessing, and PostProcessing.
Definition at line 146 of file MLBase.cpp.
|
virtual |
This saves the trained model to a file. This function should be overwritten by the derived class.
file | a reference to the file the model will be saved to |
Reimplemented in SelfOrganizingMap, HierarchicalClustering, DTW, ClassLabelTimeoutFilter, HMM, FFT, FiniteStateMachine, KMeans, RBMQuantizer, LDA, RandomForests, ZeroCrossingCounter, AdaBoost, SOMQuantizer, DecisionTree, ANBC, SVM, KNN, MovementTrajectoryFeatures, FIRFilter, ClusterTree, FFTFeatures, RegressionTree, KMeansFeatures, BAG, GaussianMixtureModels, MovementIndex, ClassLabelFilter, MLP, SwipeDetector, GMM, KMeansQuantizer, LowPassFilter, PrincipalComponentAnalysis, HighPassFilter, TimeseriesBuffer, Derivative, SavitzkyGolayFilter, MinDist, Softmax, PreProcessing, TimeDomainFeatures, DeadZone, ClassLabelChangeFilter, DoubleMovingAverageFilter, MedianFilter, MovingAverageFilter, BernoulliRBM, PostProcessing, FeatureExtraction, MultidimensionalRegression, WeightedAverageFilter, LeakyIntegrator, LinearRegression, LogisticRegression, ParticleClassifier, DiscreteHiddenMarkovModel, ContinuousHiddenMarkovModel, and MovementDetector.
Definition at line 162 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].
x | the value that should be scaled |
minSource | the minimum range that x originates from |
maxSource | the maximum range that x originates from |
minTarget | the minimum range that x should be scaled to |
maxTarget | the maximum range that x should be scaled to |
constrain | sets if the scaled value should be constrained to the target range |
bool MLBase::setLearningRate | ( | const Float | 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.
learningRate | the learningRate value used during the training phase, must be greater than zero |
Definition at line 291 of file MLBase.cpp.
bool 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.
maxNumIterations | the maximum number of iterations value, must be greater than zero |
Definition at line 268 of file MLBase.cpp.
bool MLBase::setMinChange | ( | const Float | 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.
minChange | the minimum change value, must be greater than zero |
Definition at line 282 of file MLBase.cpp.
bool 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.
minNumEpochs | the minimum number of epochs that can elapse with no change between two training epochs |
Definition at line 277 of file MLBase.cpp.
bool 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.
randomiseTrainingOrder | if true then the order in which training samples are supplied to a learning algorithm will be randomised |
Definition at line 316 of file MLBase.cpp.
bool MLBase::setTrainingLoggingEnabled | ( | const bool | loggingEnabled | ) |
Sets if training logging is enabled/disabled for this specific ML instance. If you want to enable/disable training logging globally, then you should use the TrainingLog::enableLogging( bool ) function.
loggingEnabled | if true then training logging will be enabled, if false then training logging will be disabled |
Definition at line 321 of file MLBase.cpp.
bool 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.
validationSetSize | the new validation set size (as a percentage) |
Definition at line 311 of file MLBase.cpp.
bool 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.
validationSetSize | the new validation set size (as a percentage) |
Definition at line 299 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.
trainingData | the training data that will be used to train the ML model |
Reimplemented in LDA, and HMM.
Definition at line 88 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.
trainingData | the training data that will be used to train a new regression model |
Definition at line 92 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.
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 ClassificationDataStream. By default it will call the train_ function, unless it is overwritten by the derived class.
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 UnlabelledData. By default it will call the train_ function, unless it is overwritten by the derived class.
trainingData | the training data that will be used to train the ML model |
Definition at line 104 of file MLBase.cpp.
|
virtual |
This is the main training interface for MatrixFloat data. By default it will call the train_ function, unless it is overwritten by the derived class.
trainingData | the training data that will be used to train the ML model |
Definition at line 108 of file MLBase.cpp.
|
virtual |
This is the main training interface for referenced ClassificationData. This should be overwritten by the derived class.
trainingData | a reference to the training data that will be used to train the ML model |
Reimplemented in SelfOrganizingMap, HierarchicalClustering, RBMQuantizer, SOMQuantizer, KMeansFeatures, KMeansQuantizer, KMeans, AdaBoost, SVM, KNN, RandomForests, GaussianMixtureModels, DecisionTree, ANBC, GMM, BAG, MinDist, Softmax, SwipeDetector, FiniteStateMachine, MLP, and Clusterer.
Definition at line 90 of file MLBase.cpp.
|
virtual |
This is the main training interface for all the regression algorithms. This should be overwritten by the derived class.
trainingData | the training data that will be used to train a new regression model |
Reimplemented in RegressionTree, MLP, MultidimensionalRegression, LinearRegression, and LogisticRegression.
Definition at line 94 of file MLBase.cpp.
|
virtual |
This is the main training interface for referenced TimeSeriesClassificationData. This should be overwritten by the derived class.
trainingData | a reference to the training data that will be used to train the ML model |
Reimplemented in RBMQuantizer, SOMQuantizer, DTW, KMeansFeatures, KMeansQuantizer, HMM, FiniteStateMachine, and ParticleClassifier.
Definition at line 98 of file MLBase.cpp.
|
virtual |
This is the main training interface for referenced ClassificationDataStream. This should be overwritten by the derived class.
trainingData | a reference to the training data that will be used to train the ML model |
Reimplemented in RBMQuantizer, SOMQuantizer, KMeansFeatures, KMeansQuantizer, and FiniteStateMachine.
Definition at line 102 of file MLBase.cpp.
|
virtual |
This is the main training interface for referenced UnlabelledData. This should be overwritten by the derived class.
trainingData | a reference to the training data that will be used to train the ML model |
Reimplemented in SelfOrganizingMap, HierarchicalClustering, RBMQuantizer, SOMQuantizer, KMeansFeatures, KMeansQuantizer, KMeans, GaussianMixtureModels, and Clusterer.
Definition at line 106 of file MLBase.cpp.
|
virtual |
This is the main training interface for referenced MatrixFloat data. This should be overwritten by the derived class.
trainingData | a reference to the training data that will be used to train the ML model |
Reimplemented in SelfOrganizingMap, HierarchicalClustering, RBMQuantizer, SOMQuantizer, KMeansFeatures, KMeansQuantizer, KMeans, GaussianMixtureModels, ClusterTree, BernoulliRBM, and Clusterer.
Definition at line 110 of file MLBase.cpp.