weka.classifiers.meta

## Class RandomCommittee

- java.lang.Object
- - weka.classifiers.AbstractClassifier
  - - weka.classifiers.SingleClassifierEnhancer
    - - weka.classifiers.IteratedSingleClassifierEnhancer
      - - weka.classifiers.ParallelIteratedSingleClassifierEnhancer
        - - weka.classifiers.RandomizableParallelIteratedSingleClassifierEnhancer
          - - weka.classifiers.meta.RandomCommittee

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Classifier, BatchPredictor, CapabilitiesHandler, CapabilitiesIgnorer, CommandlineRunnable, OptionHandler, PartitionGenerator, Randomizable, RevisionHandler, WeightedInstancesHandler

      public class RandomCommittee
      extends RandomizableParallelIteratedSingleClassifierEnhancer
      implements WeightedInstancesHandler, PartitionGenerator

  Class for building an ensemble of randomizable base classifiers. Each base classifiers is built using a different random number seed (but based one the same data). The final prediction is a straight average of the predictions generated by the individual base classifiers.

  Valid options are:

       -S <num>
        Random number seed.
        (default 1)

       -I <num>
        Number of iterations.
        (default 10)

       -D
        If set, classifier is run in debug mode and
        may output additional info to the console

       -W
        Full name of base classifier.
        (default: weka.classifiers.trees.RandomTree)

       Options specific to classifier weka.classifiers.trees.RandomTree:

       -K <number of attributes>
        Number of attributes to randomly investigate
        (<1 = int(log(#attributes)+1)).

       -M <minimum number of instances>
        Set minimum number of instances per leaf.

       -S <num>
        Seed for random number generator.
        (default 1)

       -depth <num>
        The maximum depth of the tree, 0 for unlimited.
        (default 0)

       -D
        If set, classifier is run in debug mode and
        may output additional info to the console

  Options after -- are passed to the designated classifier.

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

- - ### Field Summary

    - ### Fields inherited from class weka.classifiers.AbstractClassifier

      `BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RandomCommittee()` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `buildClassifier(Instances data)` Builds the committee of randomizable classifiers.
    `double[]` | `distributionForInstance(Instance instance)` Calculates the class membership probabilities for the given test instance.
    `void` | `generatePartition(Instances data)` Builds the classifier to generate a partition.
    `double[]` | `getMembershipValues(Instance inst)` Computes an array that indicates leaf membership
    `java.lang.String` | `getRevision()` Returns the revision string.
    `java.lang.String` | `globalInfo()` Returns a string describing classifier
    `static void` | `main(java.lang.String[] argv)` Main method for testing this class.
    `int` | `numElements()` Returns the number of elements in the partition.
    `java.lang.String` | `toString()` Returns description of the committee.

    - ### Methods inherited from class weka.classifiers.RandomizableParallelIteratedSingleClassifierEnhancer

      `getOptions, getSeed, listOptions, seedTipText, setOptions, setSeed`

    - ### Methods inherited from class weka.classifiers.ParallelIteratedSingleClassifierEnhancer

      `getNumExecutionSlots, numExecutionSlotsTipText, setNumExecutionSlots`

    - ### Methods inherited from class weka.classifiers.IteratedSingleClassifierEnhancer

      `getNumIterations, numIterationsTipText, setNumIterations`

    - ### Methods inherited from class weka.classifiers.SingleClassifierEnhancer

      `classifierTipText, getCapabilities, getClassifier, postExecution, preExecution, setClassifier`

    - ### Methods inherited from class weka.classifiers.AbstractClassifier

      `batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface weka.core.CapabilitiesHandler

      `getCapabilities`

- - ### Constructor Detail

    - #### RandomCommittee

          public RandomCommittee()

      Constructor.

  - ### Method Detail

    - #### 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.
      Specified by:
        `buildClassifier` in interface `Classifier`
      Overrides:
        `buildClassifier` in class `ParallelIteratedSingleClassifierEnhancer`
      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.
      Specified by:
        `distributionForInstance` in interface `Classifier`
      Overrides:
        `distributionForInstance` in class `AbstractClassifier`
      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.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        description of the committee as a string

    - #### generatePartition

          public void generatePartition(Instances data)
                                 throws java.lang.Exception

      Builds the classifier to generate a partition.
      Specified by:
        `generatePartition` in interface `PartitionGenerator`
      Throws:
        `java.lang.Exception`

    - #### getMembershipValues

          public double[] getMembershipValues(Instance inst)
                                       throws java.lang.Exception

      Computes an array that indicates leaf membership
      Specified by:
        `getMembershipValues` in interface `PartitionGenerator`
      Throws:
        `java.lang.Exception`

    - #### numElements

          public int numElements()
                          throws java.lang.Exception

      Returns the number of elements in the partition.
      Specified by:
        `numElements` in interface `PartitionGenerator`
      Throws:
        `java.lang.Exception`

    - #### getRevision

          public java.lang.String getRevision()

      Returns the revision string.
      Specified by:
        `getRevision` in interface `RevisionHandler`
      Overrides:
        `getRevision` in class `AbstractClassifier`
      Returns:
        the revision

    - #### main

          public static void main(java.lang.String[] argv)

      Main method for testing this class.
      Parameters:
        `argv` - the options