Rapid-Mix API  v2.2.0
A simple library for machine learning & signal processing
machineLearning.h
Go to the documentation of this file.
1 
10 #ifndef machineLearning_h
11 #define machineLearning_h
12 
13 #include "rapidMix.h"
14 
16 #include "classification.h"
17 #include "regression.h"
18 #include "seriesClassification.h"
19 #include "rapidXMM.h"
20 #include "rapidGVF.h"
21 
22 namespace rapidmix {
23 
24  // forward declaration
25  class trainingData;
26 
28  typedef struct runResults_t {
29  std::vector<double> likelihoods;
30  std::vector<double> regression;
31  std::vector<double> progressions;
32  std::string likeliest;
33  } runResults;
34 
38  template <typename MachineLearningModule>
39  class machineLearning : public MachineLearningModule {
40  public:
41 
42  //* Constructors */
43  machineLearning() : MachineLearningModule() {};
44 
45  template<class T>
46  machineLearning(T type) : MachineLearningModule(type) {};
47 
51  bool train(const trainingData &newTrainingData);
52 
53  //* this function is not being specialized
54  std::vector<double> run(const std::vector<double> &inputVector) {
55  return MachineLearningModule::run(inputVector);
56  }
57 
58  // This is a hack while I think about how to do this. -MZ //
59  std::string run(const std::vector<double> &inputVector, const std::string &label);
60 
61  //* This is the one I'm using for DTW */
62  std::string run(const std::vector<std::vector<double> > &inputSeries);
63 
64  bool reset() {
65  return MachineLearningModule::reset();
66  }
67 
68  private:
69  MachineLearningModule module;
70 
71  //this holds string labels
72  std::vector<std::string> labels; //FIXME: This probably should be pushed down into rapidLib?
73  std::string getLabel(int value);
74 
75  };
76 
78 
80 
83 
86 
89 
91 
94 
97 
100 
103 
106 
108 
111 
112 
113 }
114 
115 #endif
bool reset()
Definition: machineLearning.h:64
std::vector< double > run(const std::vector< double > &inputVector)
Definition: machineLearning.h:54
machineLearning< rapidXmmHmr > xmmTemporalRegression
temporal regression using Hierarchical Hidden Markov Models from XMM
Definition: machineLearning.h:105
machineLearning()
Definition: machineLearning.h:43
machineLearning< regression< double > > staticRegression
static regression using Neural Networks from RapidLib
Definition: machineLearning.h:85
Definition: rapidXMM.h:52
machineLearning< rapidXmmGmr > xmmStaticRegression
static regression using Gaussian Mixture Models from XMM
Definition: machineLearning.h:99
Definition: machineLearning.cpp:11
machineLearning< classification< double > > staticClassification
static classification using KNN from RapidLib
Definition: machineLearning.h:82
machineLearning< rapidGVF > gvfTemporalVariation
temporal variation estimation using GVF library
Definition: machineLearning.h:110
machineLearning< seriesClassification< double > > dtwTemporalClassification
temporal classification using Dynamic Time Warping from RapidLib
Definition: machineLearning.h:88
xmmToolConfig xmmConfig
configuration for XMM based algorithms
Definition: machineLearning.h:93
Host class for machine learning algorithms.
Definition: machineLearning.h:39
Definition: trainingData.h:24
std::vector< double > likelihoods
Definition: machineLearning.h:29
machineLearning(T type)
Definition: machineLearning.h:46
std::vector< double > progressions
Definition: machineLearning.h:31
machineLearning< rapidXmmHmm > xmmTemporalClassification
temporal classification using Hierarchical Hidden Markov Models from XMM
Definition: machineLearning.h:102
std::vector< double > regression
Definition: machineLearning.h:30
std::string likeliest
Definition: machineLearning.h:32
machineLearning< rapidXmmGmm > xmmStaticClassification
static classification using Gaussian Mixture Models from XMM
Definition: machineLearning.h:96
struct rapidmix::runResults_t runResults
A generic ouptut struct to fit all kinds of models.
A generic ouptut struct to fit all kinds of models.
Definition: machineLearning.h:28