philsupertramp/game-math
|
#include <Perceptron.h>
Public Member Functions | |
Perceptron (double _eta=0.01, int iter=10) | |
void | fit (const Matrix< double > &X, const Matrix< double > &y) override |
Matrix< double > | netInput (const Matrix< double > &X) override |
Matrix< double > | activation (const Matrix< double > &X) override |
Matrix< double > | predict (const Matrix< double > &X) override |
double | costFunction (const Matrix< double > &X) override |
Public Member Functions inherited from ANNClassifier | |
ANNClassifier (double _eta, int _n_iter) | |
virtual Matrix< double > | activation (const Matrix< double > &)=0 |
virtual Matrix< double > | netInput (const Matrix< double > &)=0 |
virtual double | costFunction (const Matrix< double > &)=0 |
Public Member Functions inherited from Classifier | |
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 |
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 |
Additional Inherited Members | |
Public Attributes inherited from Classifier | |
Matrix< double > | weights |
Vector holding weights. More... | |
Matrix< double > | costs |
Vector holding classification error per epoch. More... | |
Protected Attributes inherited from ANNClassifier | |
double | eta |
Learning rate. More... | |
int | n_iter |
number epochs More... | |
Protected Attributes inherited from Classifier | |
bool | w_initialized = false |
flag to initialize weights only once More... | |
Represents Perceptron definition by Frank Rosenblatt
Essentially it can be used to build binary classification One might for example want to replace some very complex binary operation which is a combination of several broad operations like OR|AND|XOR|NOT ...
In order to use the perceptron classifier one needs access to the full set of possible transformations.
THIS IS NOT A PREDICTOR
Mainly implemented for academic use
|
inlineexplicit |
default constructor
_eta | |
iter |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
X | array-like with the shape: [n_samples, n_features] |
y | array-like with shape: [n_samples, 1] |
Implements Predictor.