#include <classification.h>
Public Types | |
enum | classificationTypes { knn , svm } |
Public Member Functions | |
classificationTemplate () | |
classificationTemplate (classificationTypes classificationType) | |
classificationTemplate (const std::vector< trainingExampleTemplate< T > > &trainingSet) | |
classificationTemplate (const int &numInputs, const int &numOutputs) | |
~classificationTemplate () | |
bool | train (const std::vector< trainingExampleTemplate< T > > &trainingSet) override |
std::vector< int > | getK () |
void | setK (const int whichModel, const int newK) |
Public Member Functions inherited from modelSet< T > | |
modelSet () | |
virtual | ~modelSet () |
bool | reset () |
std::vector< T > | run (const std::vector< T > &inputVector) |
std::string | getJSON () |
void | writeJSON (const std::string &filepath) |
bool | putJSON (const std::string &jsonMessage) |
bool | readJSON (const std::string &filepath) |
Additional Inherited Members | |
Protected Member Functions inherited from modelSet< T > | |
void | threadTrain (std::size_t i, const std::vector< trainingExampleTemplate< T > > &training_set) |
Protected Attributes inherited from modelSet< T > | |
std::vector< baseModel< T > * > | myModelSet |
int | numInputs |
std::vector< std::string > | inputNames |
int | numOutputs |
bool | isTraining |
bool | isTrained |
Class for implementing a set of classification models.
This doesn't do anything modelSet can't do. But, it's simpler and more like wekinator.
enum classificationTemplate::classificationTypes |
classificationTemplate< T >::classificationTemplate |
Create with no arguments
Default classifier is kNN.
classificationTemplate< T >::classificationTemplate | ( | classificationTypes | classificationType | ) |
Specify classification type
Enum | Classification type: knn or svm |
classificationTemplate< T >::classificationTemplate | ( | const std::vector< trainingExampleTemplate< T > > & | trainingSet | ) |
create based on training set inputs and outputs
classificationTemplate< T >::classificationTemplate | ( | const int & | numInputs, |
const int & | numOutputs | ||
) |
create with proper models, but not trained
|
inline |
destructor
std::vector< int > classificationTemplate< T >::getK |
Check the K values for each model.
This feature is temporary, and will be replaced by a different design.
void classificationTemplate< T >::setK | ( | const int | whichModel, |
const int | newK | ||
) |
Set the K values for each model. This feature is temporary, and will be replaced by a different design.
int | which model to set |
int | k value for that model |
|
overridevirtual |
Train on a specified set, causes creation if not created
vector | Vector of training examples, type T |
Reimplemented from modelSet< T >.