Class Perceptron implements the standard linear (online) perceptron.
Given a maximum number of iterations (the standard perceptron algorithm is not guaranteed to converge) and a fixed lerning rate, the result is a linear classifier.
Definition at line 30 of file Perceptron.h.

Public Member Functions | |
| CPerceptron () | |
| CPerceptron (CDotFeatures *traindat, CLabels *trainlab) | |
| virtual | ~CPerceptron () | 
| virtual EClassifierType | get_classifier_type () | 
| virtual bool | train (CFeatures *data=NULL) | 
| void | set_learn_rate (float64_t r) | 
| set learn rate of gradient descent training algorithm   | |
| void | set_max_iter (int32_t i) | 
| set maximum number of iterations   | |
| virtual const char * | get_name () const | 
Protected Attributes | |
| float64_t | learn_rate | 
| int32_t | max_iter | 
| CPerceptron | ( | ) | 
default constructor
Definition at line 17 of file Perceptron.cpp.
| CPerceptron | ( | CDotFeatures * | traindat, | |
| CLabels * | trainlab | |||
| ) | 
constructor
| traindat | training features | |
| trainlab | labels for training features | 
Definition at line 22 of file Perceptron.cpp.
| ~CPerceptron | ( | ) |  [virtual] | 
        
Definition at line 29 of file Perceptron.cpp.
| virtual EClassifierType get_classifier_type | ( | ) |  [virtual] | 
        
get classifier type
Reimplemented from CClassifier.
Definition at line 48 of file Perceptron.h.
| virtual const char* get_name | ( | void | ) |  const [virtual] | 
        
Reimplemented from CLinearClassifier.
Definition at line 73 of file Perceptron.h.
| void set_learn_rate | ( | float64_t | r | ) | 
set learn rate of gradient descent training algorithm
Definition at line 61 of file Perceptron.h.
| void set_max_iter | ( | int32_t | i | ) | 
set maximum number of iterations
Definition at line 67 of file Perceptron.h.
| bool train | ( | CFeatures * |  data = NULL | 
          ) |  [virtual] | 
        
train classifier
| data | training data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data) | 
Reimplemented from CClassifier.
Definition at line 33 of file Perceptron.cpp.
float64_t learn_rate [protected] | 
        
learning rate
Definition at line 77 of file Perceptron.h.
int32_t max_iter [protected] | 
        
maximum number of iterations
Definition at line 79 of file Perceptron.h.