Commit db220457 authored by Michael Zbyszyński's avatar Michael Zbyszyński
Browse files

small adjustment to includes

parent 93ebd16a
......@@ -10,6 +10,15 @@
namespace rapidmix {
//////////////////////////////////////////////////////////////////////// Generic train
template <class MachineLearningModule>
bool machineLearning<MachineLearningModule>::train(const trainingData &newTrainingData) {
return MachineLearningModule::train(newTrainingData);
}
/////////////////////////////////////////////////////////////////////// RapidLib specializations
void trainingData2rapidLib (const trainingData &newTrainingData, std::vector<trainingExample<double> > &trainingSet) {
for (int h = 0; h < newTrainingData.trainingSet.size(); ++h) { //Go through every phrase
......@@ -26,6 +35,7 @@ namespace rapidmix {
}
};
/////////////////////////////////////////////////////////////////////// RapidLib classification
template<>
bool machineLearning<classification<double>>::train(const trainingData &newTrainingData) {
std::vector<trainingExample<double> > trainingSet;
......@@ -37,6 +47,7 @@ namespace rapidmix {
return classification::train(trainingSet);
}
/////////////////////////////////////////////////////////////////////// RapidLib regression
template<>
bool machineLearning<regression<double> >::train(const trainingData &newTrainingData) {
std::vector<trainingExample<double> > trainingSet;
......@@ -44,6 +55,7 @@ namespace rapidmix {
return regression::train(trainingSet);
}
/////////////////////////////////////////////////////////////////////// RapidLib seriesClassification
template<>
bool machineLearning<seriesClassification<double> >::train(const trainingData &newTrainingData) {
std::vector<trainingSeries<double> > seriesSet;
......@@ -58,18 +70,6 @@ namespace rapidmix {
return seriesClassification::train(seriesSet);
}
template<>
bool machineLearning<rapidGVF>::train(const trainingData &newTrainingData) {
return rapidGVF::train(newTrainingData);
}
///Generic train
template <class MachineLearningModule>
bool machineLearning<MachineLearningModule>::train(const trainingData &newTrainingData) {
return MachineLearningModule::train(newTrainingData);
}
template<>
std::string machineLearning<classification<double> >::run(const std::vector<double> &inputVector, const std::string &label) {
int classIndex = classification::run(inputVector)[0];
......@@ -81,4 +81,11 @@ namespace rapidmix {
return seriesClassification::run(inputSeries);
}
/////////////////////////////////////////////////////////////////////// GVF
template<>
bool machineLearning<rapidGVF>::train(const trainingData &newTrainingData) {
return rapidGVF::train(newTrainingData);
}
}
\ No newline at end of file
......@@ -10,7 +10,7 @@
#ifndef machineLearning_h
#define machineLearning_h
#include "rapidMix.h"
#include "../rapidMix.h"
////////// Include all of the machine learning algorithms here
#include "classification.h"
......
......@@ -15,7 +15,7 @@
#include <string>
#include <unordered_map>
#include "rapidMix.h"
#include "../rapidMix.h"
#include "json.h"
namespace rapidmix {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment