weka.classifiers.meta
Class RandomCommittee

java.lang.Object
  extended byweka.classifiers.Classifier
      extended byweka.classifiers.SingleClassifierEnhancer
          extended byweka.classifiers.IteratedSingleClassifierEnhancer
              extended byweka.classifiers.RandomizableIteratedSingleClassifierEnhancer
                  extended byweka.classifiers.meta.RandomCommittee
All Implemented Interfaces:
java.lang.Cloneable, OptionHandler, Randomizable, java.io.Serializable, WeightedInstancesHandler

public class RandomCommittee
extends RandomizableIteratedSingleClassifierEnhancer
implements WeightedInstancesHandler

Class for creating a committee of random classifiers. The base classifier (that forms the committee members) needs to implement the Randomizable interface. Valid options are:

-W classname
Specify the full class name of a base classifier as the basis for the random committee (required).

-I num
Set the number of committee members (default 10).

-S seed
Random number seed for the randomization process (default 1).

Options after -- are passed to the designated classifier.

Version:
$Revision: 1.5 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class weka.classifiers.RandomizableIteratedSingleClassifierEnhancer
m_Seed
 
Fields inherited from class weka.classifiers.IteratedSingleClassifierEnhancer
m_Classifiers, m_NumIterations
 
Fields inherited from class weka.classifiers.SingleClassifierEnhancer
m_Classifier
 
Fields inherited from class weka.classifiers.Classifier
m_Debug
 
Constructor Summary
RandomCommittee()
          Constructor.
 
Method Summary
 void buildClassifier(Instances data)
          Builds the committee of randomizable classifiers.
protected  java.lang.String defaultClassifierString()
          String describing default classifier.
 double[] distributionForInstance(Instance instance)
          Calculates the class membership probabilities for the given test instance.
 java.lang.String globalInfo()
          Returns a string describing classifier
static void main(java.lang.String[] argv)
          Main method for testing this class.
 java.lang.String toString()
          Returns description of the committee.
 
Methods inherited from class weka.classifiers.RandomizableIteratedSingleClassifierEnhancer
getOptions, getSeed, listOptions, seedTipText, setOptions, setSeed
 
Methods inherited from class weka.classifiers.IteratedSingleClassifierEnhancer
getNumIterations, numIterationsTipText, setNumIterations
 
Methods inherited from class weka.classifiers.SingleClassifierEnhancer
classifierTipText, getClassifier, getClassifierSpec, setClassifier
 
Methods inherited from class weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, makeCopies, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomCommittee

public RandomCommittee()
Constructor.

Method Detail

defaultClassifierString

protected java.lang.String defaultClassifierString()
String describing default classifier.

Overrides:
defaultClassifierString in class SingleClassifierEnhancer

globalInfo

public java.lang.String globalInfo()
Returns a string describing classifier

Returns:
a description suitable for displaying in the explorer/experimenter gui

buildClassifier

public void buildClassifier(Instances data)
                     throws java.lang.Exception
Builds the committee of randomizable classifiers.

Overrides:
buildClassifier in class IteratedSingleClassifierEnhancer
Parameters:
data - the training data to be used for generating the bagged classifier.
Throws:
java.lang.Exception - if the classifier could not be built successfully

distributionForInstance

public double[] distributionForInstance(Instance instance)
                                 throws java.lang.Exception
Calculates the class membership probabilities for the given test instance.

Overrides:
distributionForInstance in class Classifier
Parameters:
instance - the instance to be classified
Returns:
preedicted class probability distribution
Throws:
java.lang.Exception - if distribution can't be computed successfully

toString

public java.lang.String toString()
Returns description of the committee.

Returns:
description of the committee as a string

main

public static void main(java.lang.String[] argv)
Main method for testing this class.

Parameters:
argv - the options