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

Majority class learner. More...

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

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.
double[] getVotesForInstance (Instance i)
 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.

Protected Member Functions

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

Protected Attributes

DoubleVector observedClassDistribution

Detailed Description

Majority class learner.

This is the simplest classifier.

Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)
Version:
Revision:
7

Definition at line 34 of file MajorityClass.java.


Member Function Documentation

void moa.classifiers.functions.MajorityClass.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 65 of file MajorityClass.java.

Here is the call graph for this function:

Measurement [] moa.classifiers.functions.MajorityClass.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 60 of file MajorityClass.java.

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

Gets the purpose of this object.

Returns:
the string with the purpose of this object

Reimplemented from moa.classifiers.AbstractClassifier.

Definition at line 39 of file MajorityClass.java.

double [] moa.classifiers.functions.MajorityClass.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 55 of file MajorityClass.java.

Here is the call graph for this function:

boolean moa.classifiers.functions.MajorityClass.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 80 of file MajorityClass.java.

void moa.classifiers.functions.MajorityClass.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 46 of file MajorityClass.java.

void moa.classifiers.functions.MajorityClass.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 51 of file MajorityClass.java.

Here is the call graph for this function:


Member Data Documentation


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