philsupertramp/game-math
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Classifier Class Reference

#include <Classifier.h>

Inheritance diagram for Classifier:
Predictor ANNClassifier KNN NCC AdalineGD AdalineSGD LogRegSGD Perceptron

Public Member Functions

 Classifier ()
 
void initialize_weights (size_t numRows, size_t numColumns=1)
 
void update_weights (const Matrix< double > &update, const Matrix< double > &delta)
 
Matrix< double > transform (const Matrix< double > &in) override
 
- Public Member Functions inherited from Predictor
virtual void fit (const Matrix< double > &X, const Matrix< double > &y)=0
 
virtual Matrix< double > predict (const Matrix< double > &)=0
 
virtual Matrix< double > transform (const Matrix< double > &)=0
 

Public Attributes

Matrix< double > weights
 Vector holding weights. More...
 
Matrix< double > costs
 Vector holding classification error per epoch. More...
 

Protected Attributes

bool w_initialized = false
 flag to initialize weights only once More...
 

Detailed Description

Classifier template class

Inherit and implement:

Constructor & Destructor Documentation

◆ Classifier()

Classifier::Classifier ( )
inline

default constructor

Parameters
_etalearning rate
_n_iternumber learning iterations

Member Function Documentation

◆ initialize_weights()

void Classifier::initialize_weights ( size_t  numRows,
size_t  numColumns = 1 
)
inline

Initialization method for weights hold by the classifier

Parameters
numRowsnumber rows
numColumnsnumber columns

◆ transform()

Matrix< double > Classifier::transform ( const Matrix< double > &  in)
inlineoverridevirtual

Implements Predictor.

◆ update_weights()

void Classifier::update_weights ( const Matrix< double > &  update,
const Matrix< double > &  delta 
)
inline

Member Data Documentation

◆ costs

Matrix<double> Classifier::costs

Vector holding classification error per epoch.

◆ w_initialized

bool Classifier::w_initialized = false
protected

flag to initialize weights only once

◆ weights

Matrix<double> Classifier::weights

Vector holding weights.


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