Public Member Functions | Protected Attributes

CAveragedPerceptron Class Reference


Detailed Description

Class Averaged Perceptron implements the standard linear (online) algorithm. Averaged perceptron is the simple extension of Perceptron.

Given a maximum number of iterations (the standard averaged perceptron algorithm is not guaranteed to converge) and a fixed lerning rate, the result is a linear classifier.

See also:
CLinearMachine

Definition at line 30 of file AveragedPerceptron.h.

Inheritance diagram for CAveragedPerceptron:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CAveragedPerceptron ()
 CAveragedPerceptron (CDotFeatures *traindat, CLabels *trainlab)
virtual ~CAveragedPerceptron ()
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

Constructor & Destructor Documentation

default constructor

Definition at line 16 of file AveragedPerceptron.cpp.

CAveragedPerceptron ( CDotFeatures traindat,
CLabels trainlab 
)

constructor

Parameters:
traindat training features
trainlab labels for training features

Definition at line 21 of file AveragedPerceptron.cpp.

~CAveragedPerceptron (  )  [virtual]

Definition at line 28 of file AveragedPerceptron.cpp.


Member Function Documentation

virtual EClassifierType get_classifier_type (  )  [virtual]

get classifier type

Returns:
classifier type AVERAGEDPERCEPTRON

Reimplemented from CMachine.

Definition at line 48 of file AveragedPerceptron.h.

virtual const char* get_name (  )  const [virtual]
Returns:
object name

Reimplemented from CLinearMachine.

Definition at line 73 of file AveragedPerceptron.h.

void set_learn_rate ( float64_t  r  ) 

set learn rate of gradient descent training algorithm

Definition at line 61 of file AveragedPerceptron.h.

void set_max_iter ( int32_t  i  ) 

set maximum number of iterations

Definition at line 67 of file AveragedPerceptron.h.

bool train ( CFeatures data = NULL  )  [virtual]

train classifier

Parameters:
data training data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data)
Returns:
whether training was successful

Reimplemented from CMachine.

Definition at line 32 of file AveragedPerceptron.cpp.


Member Data Documentation

float64_t learn_rate [protected]

learning rate

Definition at line 77 of file AveragedPerceptron.h.

int32_t max_iter [protected]

maximum number of iterations

Definition at line 79 of file AveragedPerceptron.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation