CPerceptron Class Reference


Detailed Description

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.

See also:
CLinearClassifier
http://en.wikipedia.org/wiki/Perceptron

Definition at line 28 of file Perceptron.h.

Inheritance diagram for CPerceptron:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CPerceptron ()
 CPerceptron (CDotFeatures *traindat, CLabels *trainlab)
virtual ~CPerceptron ()
virtual EClassifierType get_classifier_type ()
virtual bool train ()
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

CPerceptron::CPerceptron (  ) 

default constructor

Definition at line 15 of file Perceptron.cpp.

CPerceptron::CPerceptron ( CDotFeatures traindat,
CLabels trainlab 
)

constructor

Parameters:
traindat training features
trainlab labels for training features

Definition at line 20 of file Perceptron.cpp.

CPerceptron::~CPerceptron (  )  [virtual]

Definition at line 27 of file Perceptron.cpp.


Member Function Documentation

virtual EClassifierType CPerceptron::get_classifier_type (  )  [virtual]

get classifier type

Returns:
classifier type PERCEPTRON

Reimplemented from CClassifier.

Definition at line 46 of file Perceptron.h.

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

Implements CSGObject.

Definition at line 67 of file Perceptron.h.

void CPerceptron::set_learn_rate ( float64_t  r  ) 

set learn rate of gradient descent training algorithm

Definition at line 55 of file Perceptron.h.

void CPerceptron::set_max_iter ( int32_t  i  ) 

set maximum number of iterations

Definition at line 61 of file Perceptron.h.

bool CPerceptron::train (  )  [virtual]

train classifier

Returns:
if training was successful

Reimplemented from CClassifier.

Definition at line 31 of file Perceptron.cpp.


Member Data Documentation

learning rate

Definition at line 71 of file Perceptron.h.

int32_t CPerceptron::max_iter [protected]

maximum number of iterations

Definition at line 73 of file Perceptron.h.


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

SHOGUN Machine Learning Toolbox - Documentation