weka.classifiers.meta

## Class RandomizableFilteredClassifier

- java.lang.Object
- - weka.classifiers.AbstractClassifier
  - - weka.classifiers.SingleClassifierEnhancer
    - - weka.classifiers.RandomizableSingleClassifierEnhancer
      - - weka.classifiers.meta.FilteredClassifier
        - - weka.classifiers.meta.RandomizableFilteredClassifier

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

      public class RandomizableFilteredClassifier
      extends FilteredClassifier

  Class for running an arbitrary classifier on data that has been passed through an arbitrary filter. Like the classifier, the structure of the filter is based exclusively on the training data and test instances will be processed by the filter without changing their structure.

  Valid options are:

       -F <filter specification>
        Full class name of filter to use, followed
        by filter options.
        default: "weka.filters.unsupervised.attribute.RandomProjection -N 10 -D Sparse1"

       -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.lazy.IBk)

       -S num
       Set the random number seed (default 1).

       Options specific to classifier weka.classifiers.lazy.IBk:

       -I
        Weight neighbours by the inverse of their distance
        (use when k > 1)

       -F
        Weight neighbours by 1 - their distance
        (use when k > 1)

       -K <number of neighbors>
        Number of nearest neighbours (k) used in classification.
        (Default = 1)

       -E
        Minimise mean squared error rather than mean absolute
        error when using -X option with numeric prediction.

       -W <window size>
        Maximum number of training instances maintained.
        Training instances are dropped FIFO. (Default = no window)

       -X
        Select the number of nearest neighbours between 1
        and the k value specified using hold-one-out evaluation
        on the training data (use when k > 1)

       -A
        The nearest neighbour search algorithm to use (default: weka.core.neighboursearch.LinearNNSearch).

  Version:
    $Revision: 9117 $
  Author:
    Eibe Frank
  See Also:
    Serialized Form

- - ### Field Summary

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

      `BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT`

    - ### Fields inherited from interface weka.core.Drawable

      `BayesNet, Newick, NOT_DRAWABLE, TREE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RandomizableFilteredClassifier()` Default constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `buildClassifier(Instances data)` Build the classifier on the filtered data.
    `java.lang.String` | `getRevision()` Returns the revision string.
    `java.lang.String` | `globalInfo()` Returns a string describing this classifier
    `void` | `initializeClassifier(Instances data)` Initializes an iterative classifier.
    `static void` | `main(java.lang.String[] argv)` Main method for testing this class.
    `java.lang.String` | `toString()` Output a representation of this classifier

    - ### Methods inherited from class weka.classifiers.meta.FilteredClassifier

      `batchSizeTipText, distributionForInstance, distributionsForInstances, done, doNotCheckForModifiedClassAttributeTipText, filterTipText, generatePartition, getBatchSize, getCapabilities, getDoNotCheckForModifiedClassAttribute, getFilter, getMembershipValues, getOptions, graph, graphType, implementsMoreEfficientBatchPrediction, listOptions, next, numElements, setBatchSize, setDoNotCheckForModifiedClassAttribute, setFilter, setOptions`

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

      `getSeed, seedTipText, setSeed`

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

      `classifierTipText, getClassifier, postExecution, preExecution, setClassifier`

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

      `classifyInstance, debugTipText, doNotCheckCapabilitiesTipText, forName, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces`

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

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

    - ### Methods inherited from interface weka.classifiers.Classifier

      `classifyInstance`

- - ### Constructor Detail

    - #### RandomizableFilteredClassifier

          public RandomizableFilteredClassifier()

      Default constructor.

  - ### Method Detail

    - #### globalInfo

          public java.lang.String globalInfo()

      Returns a string describing this classifier
      Overrides:
        `globalInfo` in class `FilteredClassifier`
      Returns:
        a description of the classifier suitable for displaying in the explorer/experimenter gui

    - #### initializeClassifier

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

      Initializes an iterative classifier. (If the base classifier supports this.)
      Specified by:
        `initializeClassifier` in interface `IterativeClassifier`
      Overrides:
        `initializeClassifier` in class `FilteredClassifier`
      Parameters:
        `data` - the instances to be used in induction
      Throws:
        `java.lang.Exception` - if the model cannot be initialized

    - #### buildClassifier

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

      Build the classifier on the filtered data.
      Specified by:
        `buildClassifier` in interface `Classifier`
      Overrides:
        `buildClassifier` in class `FilteredClassifier`
      Parameters:
        `data` - the training data
      Throws:
        `java.lang.Exception` - if the classifier could not be built successfully

    - #### toString

          public java.lang.String toString()

      Output a representation of this classifier
      Overrides:
        `toString` in class `FilteredClassifier`
      Returns:
        a representation of this classifier

    - #### getRevision

          public java.lang.String getRevision()

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

    - #### main

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

      Main method for testing this class.
      Parameters:
        `argv` - should contain the following arguments: -t training file [-T test file] [-c class index]