MOA 12.03
Real Time Analytics for Data Streams
|
Single perceptron classifier. More...
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 |
Single perceptron classifier.
Performs classic perceptron multiclass learning incrementally.
Parameters:
Definition at line 37 of file Perceptron.java.
void moa.classifiers.functions.Perceptron.getModelDescription | ( | StringBuilder | out, |
int | indent | ||
) | [virtual] |
Returns a string representation of the model.
out | the stringbuilder to add the description |
indent | the 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.
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.
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.
inst | the instance to be classified |
Implements moa.classifiers.Classifier.
Definition at line 126 of file Perceptron.java.
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.
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().
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.
inst | the instance to be used for training |
Implements moa.classifiers.AbstractClassifier.
Definition at line 64 of file Perceptron.java.
FloatOption moa.classifiers.functions.Perceptron.learningRatioOption = new FloatOption("learningRatio", 'r', "Learning ratio", 1) |
Definition at line 46 of file Perceptron.java.
Referenced by moa.classifiers.functions.Perceptron.trainOnInstanceImpl().
int moa.classifiers.functions.Perceptron.numberAttributes [protected] |
Definition at line 52 of file Perceptron.java.
Referenced by moa.classifiers.functions.Perceptron.getNumberAttributes(), and moa.classifiers.functions.Perceptron.trainOnInstanceImpl().
int moa.classifiers.functions.Perceptron.numberClasses [protected] |
Definition at line 54 of file Perceptron.java.
Referenced by moa.classifiers.functions.Perceptron.getNumberClasses(), and moa.classifiers.functions.Perceptron.trainOnInstanceImpl().
int moa.classifiers.functions.Perceptron.numberDetections [protected] |
Definition at line 56 of file Perceptron.java.
boolean moa.classifiers.functions.Perceptron.reset [protected] |
Definition at line 50 of file Perceptron.java.
Referenced by moa.classifiers.functions.Perceptron.getVotesForInstance(), moa.classifiers.functions.Perceptron.resetLearningImpl(), and moa.classifiers.functions.Perceptron.trainOnInstanceImpl().
double [][] moa.classifiers.functions.Perceptron.weightAttribute [protected] |