MOA 12.03
Real Time Analytics for Data Streams
moa.classifiers.functions.Perceptron Class Reference

Single perceptron classifier. More...

Inheritance diagram for moa.classifiers.functions.Perceptron:
Collaboration diagram for moa.classifiers.functions.Perceptron:

List of all members.

Public Member Functions

String getPurposeString ()
 Gets the purpose of this object.
void resetLearningImpl ()
 Resets this classifier.
void trainOnInstanceImpl (Instance inst)
 Trains this classifier incrementally using the given instance.
void setWeights (double[][] w)
double[][] getWeights ()
int getNumberAttributes ()
int getNumberClasses ()
double prediction (Instance inst, int classVal)
double[] getVotesForInstance (Instance inst)
 Predicts the class memberships for a given instance.
void getModelDescription (StringBuilder out, int indent)
 Returns a string representation of the model.
boolean isRandomizable ()
 Gets whether this classifier needs a random seed.

Public Attributes

FloatOption learningRatioOption = new FloatOption("learningRatio", 'r', "Learning ratio", 1)

Protected Member Functions

Measurement[] getModelMeasurementsImpl ()
 Gets the current measurements of this classifier.

Protected Attributes

double[][] weightAttribute
boolean reset
int numberAttributes
int numberClasses
int numberDetections

Detailed Description

Single perceptron classifier.

Performs classic perceptron multiclass learning incrementally.

Parameters:

  • -r : Learning ratio of the classifier
Author:
Albert Bifet (abifet at cs dot waikato dot ac dot nz)
Version:
Revision:
7

Definition at line 37 of file Perceptron.java.


Member Function Documentation

void moa.classifiers.functions.Perceptron.getModelDescription ( StringBuilder  out,
int  indent 
) [virtual]

Returns a string representation of the model.

Parameters:
outthe stringbuilder to add the description
indentthe number of characters to indent

Implements moa.classifiers.AbstractClassifier.

Definition at line 147 of file Perceptron.java.

Measurement [] moa.classifiers.functions.Perceptron.getModelMeasurementsImpl ( ) [protected, virtual]

Gets the current measurements of this classifier.



The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.

Returns:
an array of measurements to be used in evaluation tasks

Implements moa.classifiers.AbstractClassifier.

Definition at line 142 of file Perceptron.java.

int moa.classifiers.functions.Perceptron.getNumberAttributes ( )

Definition at line 106 of file Perceptron.java.

int moa.classifiers.functions.Perceptron.getNumberClasses ( )

Definition at line 111 of file Perceptron.java.

String moa.classifiers.functions.Perceptron.getPurposeString ( )

Gets the purpose of this object.

Returns:
the string with the purpose of this object

Reimplemented from moa.classifiers.AbstractClassifier.

Definition at line 42 of file Perceptron.java.

double [] moa.classifiers.functions.Perceptron.getVotesForInstance ( Instance  inst)

Predicts the class memberships for a given instance.

If an instance is unclassified, the returned array elements must be all zero.

Parameters:
instthe instance to be classified
Returns:
an array containing the estimated membership probabilities of the test instance in each class

Implements moa.classifiers.Classifier.

Definition at line 126 of file Perceptron.java.

Here is the call graph for this function:

double [][] moa.classifiers.functions.Perceptron.getWeights ( )

Definition at line 101 of file Perceptron.java.

boolean moa.classifiers.functions.Perceptron.isRandomizable ( )

Gets whether this classifier needs a random seed.

Examples of methods that needs a random seed are bagging and boosting.

Returns:
true if the classifier needs a random seed.

Implements moa.classifiers.Classifier.

Definition at line 151 of file Perceptron.java.

double moa.classifiers.functions.Perceptron.prediction ( Instance  inst,
int  classVal 
)

Definition at line 116 of file Perceptron.java.

Referenced by moa.classifiers.functions.Perceptron.getVotesForInstance(), and moa.classifiers.functions.Perceptron.trainOnInstanceImpl().

Here is the caller graph for this function:

void moa.classifiers.functions.Perceptron.resetLearningImpl ( ) [virtual]

Resets this classifier.

It must be similar to starting a new classifier from scratch.

The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.

Implements moa.classifiers.AbstractClassifier.

Definition at line 59 of file Perceptron.java.

void moa.classifiers.functions.Perceptron.setWeights ( double  w[][])

Definition at line 96 of file Perceptron.java.

void moa.classifiers.functions.Perceptron.trainOnInstanceImpl ( Instance  inst) [virtual]

Trains this classifier incrementally using the given instance.



The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.

Parameters:
instthe instance to be used for training

Implements moa.classifiers.AbstractClassifier.

Definition at line 64 of file Perceptron.java.

Here is the call graph for this function:


Member Data Documentation

Definition at line 56 of file Perceptron.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations