RapidLib  v2.1.0
A simple library for interactive machine learning
classification.h
Go to the documentation of this file.
1 //
2 // classification.h
3 // RapidLib
4 //
5 // Created by mzed on 26/09/2016.
6 // Copyright © 2016 Goldsmiths. All rights reserved.
7 //
8 
9 #ifndef classification_h
10 #define classification_h
11 
12 #include <vector>
13 #include "modelSet.h"
14 
20 template<typename T>
21 class classificationTemplate : public modelSet<T> {
22 public:
23  enum classificationTypes { knn, svm };
24 
27 
29  classificationTemplate(classificationTypes classificationType);
30 
32  classificationTemplate(const std::vector<trainingExampleTemplate<T> > &trainingSet);
34  classificationTemplate(const int &numInputs, const int &numOutputs);
35 
38 
40  bool train(const std::vector<trainingExampleTemplate<T> > &trainingSet);
41 
43  std::vector<int> getK();
45  void setK(const int whichModel, const int newK);
46 
47 
48 
49 private:
50  classificationTypes classificationType;
51 };
52 
53 //This is here so that the old API still works as expected.
56 
57 #endif
Definition: classification.h:21
int numOutputs
Definition: modelSet.h:39
Definition: trainingExample.h:18
~classificationTemplate()
Definition: classification.h:37
Definition: modelSet.h:24
bool train(const std::vector< trainingExampleTemplate< T > > &trainingSet)
Definition: classification.cpp:57
int numInputs
Definition: modelSet.h:37
Definition: classification.h:23
std::vector< int > getK()
Definition: classification.cpp:96
classificationTypes
Definition: classification.h:23
Definition: classification.h:23
classificationTemplate()
Definition: classification.cpp:17
void setK(const int whichModel, const int newK)
Definition: classification.cpp:106