RapidLib  v2.2.0
A simple library for interactive machine learning
classificationTemplate< T > Class Template Referencefinal

#include <classification.h>

Inheritance diagram for classificationTemplate< T >:
Inheritance graph
Collaboration diagram for classificationTemplate< T >:
Collaboration graph

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
 

Detailed Description

template<typename T>
class classificationTemplate< T >

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.

Member Enumeration Documentation

◆ classificationTypes

template<typename T >
enum classificationTemplate::classificationTypes
Enumerator
knn 
svm 

Constructor & Destructor Documentation

◆ classificationTemplate() [1/4]

template<typename T >
classificationTemplate< T >::classificationTemplate

Create with no arguments

Default classifier is kNN.

◆ classificationTemplate() [2/4]

template<typename T >
classificationTemplate< T >::classificationTemplate ( classificationTypes  classificationType)

Specify classification type

Parameters
EnumClassification type: knn or svm

◆ classificationTemplate() [3/4]

template<typename T >
classificationTemplate< T >::classificationTemplate ( const std::vector< trainingExampleTemplate< T > > &  trainingSet)

create based on training set inputs and outputs

◆ classificationTemplate() [4/4]

template<typename T >
classificationTemplate< T >::classificationTemplate ( const int &  numInputs,
const int &  numOutputs 
)

create with proper models, but not trained

◆ ~classificationTemplate()

template<typename T >
classificationTemplate< T >::~classificationTemplate ( )
inline

destructor

Member Function Documentation

◆ getK()

template<typename T >
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.

Returns
vector K for every model

◆ setK()

template<typename T >
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.

Parameters
intwhich model to set
intk value for that model

◆ train()

template<typename T >
bool classificationTemplate< T >::train ( const std::vector< trainingExampleTemplate< T > > &  trainingSet)
overridevirtual

Train on a specified set, causes creation if not created

Parameters
vectorVector of training examples, type T
Returns
bool Successful training

Reimplemented from modelSet< T >.


The documentation for this class was generated from the following files: