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.
在文件Perceptron.h第30行定义。
公有成员 | |
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 |
保护属性 | |
float64_t | learn_rate |
int32_t | max_iter |
CPerceptron | ( | ) |
default constructor
在文件Perceptron.cpp第17行定义。
CPerceptron | ( | CDotFeatures * | traindat, |
CLabels * | trainlab | ||
) |
constructor
traindat | training features |
trainlab | labels for training features |
在文件Perceptron.cpp第22行定义。
~CPerceptron | ( | ) | [virtual] |
在文件Perceptron.cpp第29行定义。
virtual EClassifierType get_classifier_type | ( | ) | [virtual] |
virtual const char* get_name | ( | ) | const [virtual] |
void set_learn_rate | ( | float64_t | r ) |
set learn rate of gradient descent training algorithm
在文件Perceptron.h第61行定义。
void set_max_iter | ( | int32_t | i ) |
set maximum number of iterations
在文件Perceptron.h第67行定义。
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) |
重载CClassifier。
在文件Perceptron.cpp第33行定义。
float64_t learn_rate [protected] |
learning rate
在文件Perceptron.h第77行定义。
int32_t max_iter [protected] |
maximum number of iterations
在文件Perceptron.h第79行定义。