weka.classifiers.meta

## Class AutoWEKAClassifier

- java.lang.Object
- - weka.classifiers.AbstractClassifier
  - - weka.classifiers.meta.AutoWEKAClassifier

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, weka.classifiers.Classifier, weka.core.AdditionalMeasureProducer, weka.core.BatchPredictor, weka.core.CapabilitiesHandler, weka.core.CapabilitiesIgnorer, weka.core.CommandlineRunnable, weka.core.OptionHandler, weka.core.RevisionHandler

      public class AutoWEKAClassifier
      extends weka.classifiers.AbstractClassifier
      implements weka.core.AdditionalMeasureProducer

  Auto-WEKA interface for WEKA. * @author Lars Kotthoff
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected weka.attributeSelection.AttributeSelection` | `as` The chosen attribute selection method.
    `protected java.lang.String[]` | `attributeEvalArgs` The arguments of the chosen attribute evaluation method.
    `protected java.lang.String` | `attributeEvalClass` The class of the chosen attribute evaluation.
    `protected java.lang.String[]` | `attributeSearchArgs` The arguments of the chosen attribute search method.
    `protected java.lang.String` | `attributeSearchClass` The class of the chosen attribute search method.
    `protected ConfigurationCollection` | `bestConfigsCollection` The best configurations.
    `protected weka.classifiers.Classifier` | `classifier` The chosen classifier.
    `protected java.lang.String[]` | `classifierArgs` The arguments of the chosen classifier.
    `protected java.lang.String` | `classifierClass` The class of the chosen classifier.
    `static java.lang.String` | `configurationHashSetPath` The path for the log with the hashcodes for the configs we have
    `static java.lang.String` | `configurationInfoDirPath` The path for the directory with the configuration data and score
    `static java.lang.String` | `configurationRankingPath` The path for the sorted best configurations
    `protected int` | `DEFAULT_PARALLEL_RUNS` The default number of parallel threads.
    `protected double` | `estimatedMetricValue` The estimated metric value of the method chosen out of the parallel runs.
    `protected double[]` | `estimatedMetricValues` The estimated metric values of the chosen methods for each parallel run.
    `protected weka.classifiers.Evaluation` | `eval` The evaluation for the best classifier.
    `protected static java.lang.String` | `expName` The internal name of the experiment.
    `protected java.lang.String` | `extraArgs` The extra arguments for Auto-WEKA.
    `protected double` | `finalTrainTime` The time it took to train the final classifier.
    `protected int` | `memLimit` The memory limit for running classifiers.
    `protected weka.classifiers.meta.AutoWEKAClassifier.Metric` | `metric` The error metric.
    `protected java.lang.String[]` | `msExperimentPaths` The paths to the internal Auto-WEKA files.
    `protected int` | `nBestConfigs` The number of best configurations to return as output.
    `protected int` | `parallelRuns` The number of parallel threads.
    `protected weka.classifiers.meta.AutoWEKAClassifier.Resampling` | `resampling` The internal evaluation method.
    `protected java.lang.String` | `resamplingArgs` The arguments to the evaluation method.
    `protected int` | `seed` The random seed.
    `protected int` | `timeLimit` The time limit for running Auto-WEKA.
    `int` | `totalTried`

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

      `BATCH_SIZE_DEFAULT, m_BatchSize, m_Debug, m_DoNotCheckCapabilities, m_numDecimalPlaces, NUM_DECIMAL_PLACES_DEFAULT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AutoWEKAClassifier()` Constructs a new AutoWEKAClassifier.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `buildClassifier(weka.core.Instances is)` Find the best classifier, arguments, and attribute selection for the data.
    `double` | `classifyInstance(weka.core.Instance i)` Calculates the class membership for the given test instance.
    `double[]` | `distributionForInstance(weka.core.Instance i)` Calculates the class membership probabilities for the given test instance.
    `java.util.Enumeration` | `enumerateMeasures()` Returns an enumeration of the additional measure names
    `weka.core.Capabilities` | `getCapabilities()` Returns default capabilities of the classifier.
    `double` | `getMeasure(java.lang.String additionalMeasureName)` Returns the value of the named measure
    `int` | `getMemLimit()` Get the memory limit.
    `weka.classifiers.meta.AutoWEKAClassifier.Metric` | `getMetric()` Get the metric.
    `int` | `getnBestConfigs()` Get the memory limit.
    `java.lang.String[]` | `getOptions()` Returns the options of the current setup.
    `int` | `getParallelRuns()` Get the number of runs to do in parallel.
    `int` | `getSeed()` Get the random seed.
    `weka.core.TechnicalInformation` | `getTechnicalInformation()` Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
    `int` | `getTimeLimit()` Get the time limit.
    `java.lang.String` | `globalInfo()` This will return a string describing the classifier.
    `java.util.Enumeration<weka.core.Option>` | `listOptions()` Gets an enumeration describing the available options.
    `static void` | `main(java.lang.String[] argv)` Main method for testing this class.
    `double` | `measureEstimatedMetricValue()` Returns the metric value estimated during Auto-WEKA's internal evaluation.
    `java.lang.String` | `memLimitTipText()` Returns the tip text for this property.
    `java.lang.String` | `metricTipText()` Returns the tip text for this property.
    `java.lang.String` | `nBestConfigsTipText()` Returns the tip text for this property.
    `java.lang.String` | `parallelRunsTipText()` Returns the tip text for this property.
    `java.lang.String` | `seedTipText()` Returns the tip text for this property.
    `void` | `setLog(weka.gui.Logger log)` Set the WEKA logger.
    `void` | `setMemLimit(int ml)` Set the memory limit.
    `void` | `setMetric(weka.classifiers.meta.AutoWEKAClassifier.Metric m)` Set the metric.
    `void` | `setnBestConfigs(int nbc)` Set the amount of configurations that will be given as output
    `void` | `setOptions(java.lang.String[] options)` Set the options for the current setup.
    `void` | `setParallelRuns(int n)` Set the number of parallel runs.
    `void` | `setSeed(int s)` Set the random seed.
    `void` | `setTimeLimit(int tl)` Set the time limit.
    `java.lang.String` | `timeLimitTipText()` Returns the tip text for this property.
    `java.lang.String` | `toString()` This will return a string describing the classifier.

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

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

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

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

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

      `makeCopy`

- - ### Field Detail

    - #### configurationRankingPath

          public static final java.lang.String configurationRankingPath

      The path for the sorted best configurations

    - #### configurationHashSetPath

          public static final java.lang.String configurationHashSetPath

      The path for the log with the hashcodes for the configs we have

    - #### configurationInfoDirPath

          public static final java.lang.String configurationInfoDirPath

      The path for the directory with the configuration data and score

    - #### classifier

          protected weka.classifiers.Classifier classifier

      The chosen classifier.

    - #### as

          protected weka.attributeSelection.AttributeSelection as

      The chosen attribute selection method.

    - #### classifierClass

          protected java.lang.String classifierClass

      The class of the chosen classifier.

    - #### classifierArgs

          protected java.lang.String[] classifierArgs

      The arguments of the chosen classifier.

    - #### attributeSearchClass

          protected java.lang.String attributeSearchClass

      The class of the chosen attribute search method.

    - #### attributeSearchArgs

          protected java.lang.String[] attributeSearchArgs

      The arguments of the chosen attribute search method.

    - #### attributeEvalClass

          protected java.lang.String attributeEvalClass

      The class of the chosen attribute evaluation.

    - #### attributeEvalArgs

          protected java.lang.String[] attributeEvalArgs

      The arguments of the chosen attribute evaluation method.

    - #### msExperimentPaths

          protected java.lang.String[] msExperimentPaths

      The paths to the internal Auto-WEKA files.

    - #### expName

          protected static java.lang.String expName

      The internal name of the experiment.

    - #### seed

          protected int seed

      The random seed.

    - #### timeLimit

          protected int timeLimit

      The time limit for running Auto-WEKA.

    - #### memLimit

          protected int memLimit

      The memory limit for running classifiers.

    - #### nBestConfigs

          protected int nBestConfigs

      The number of best configurations to return as output.

    - #### bestConfigsCollection

          protected ConfigurationCollection bestConfigsCollection

      The best configurations.

    - #### resampling

          protected weka.classifiers.meta.AutoWEKAClassifier.Resampling resampling

      The internal evaluation method.

    - #### resamplingArgs

          protected java.lang.String resamplingArgs

      The arguments to the evaluation method.

    - #### extraArgs

          protected java.lang.String extraArgs

      The extra arguments for Auto-WEKA.

    - #### metric

          protected weka.classifiers.meta.AutoWEKAClassifier.Metric metric

      The error metric.

    - #### estimatedMetricValues

          protected double[] estimatedMetricValues

      The estimated metric values of the chosen methods for each parallel run.

    - #### estimatedMetricValue

          protected double estimatedMetricValue

      The estimated metric value of the method chosen out of the parallel runs.

    - #### eval

          protected weka.classifiers.Evaluation eval

      The evaluation for the best classifier.

    - #### DEFAULT_PARALLEL_RUNS

          protected final int DEFAULT_PARALLEL_RUNS

      The default number of parallel threads.
      See Also:
        Constant Field Values

    - #### parallelRuns

          protected int parallelRuns

      The number of parallel threads.

    - #### finalTrainTime

          protected double finalTrainTime

      The time it took to train the final classifier.

    - #### totalTried

          public int totalTried

  - ### Constructor Detail

    - #### AutoWEKAClassifier

          public AutoWEKAClassifier()

      Constructs a new AutoWEKAClassifier.

  - ### Method Detail

    - #### main

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

      Main method for testing this class.
      Parameters:
        `argv` - should contain command line options (see setOptions)

    - #### buildClassifier

          public void buildClassifier(weka.core.Instances is)
                               throws java.lang.Exception

      Find the best classifier, arguments, and attribute selection for the data.
      Specified by:
        `buildClassifier` in interface `weka.classifiers.Classifier`
      Parameters:
        `is` - the training data to be used for selecting and tuning the classifier.
      Throws:
        `java.lang.Exception` - if the classifier could not be built successfully.

    - #### classifyInstance

          public double classifyInstance(weka.core.Instance i)
                                  throws java.lang.Exception

      Calculates the class membership for the given test instance.
      Specified by:
        `classifyInstance` in interface `weka.classifiers.Classifier`
      Overrides:
        `classifyInstance` in class `weka.classifiers.AbstractClassifier`
      Parameters:
        `i` - the instance to be classified
      Returns:
        predicted class
      Throws:
        `java.lang.Exception` - if instance could not be classified successfully

    - #### distributionForInstance

          public double[] distributionForInstance(weka.core.Instance i)
                                           throws java.lang.Exception

      Calculates the class membership probabilities for the given test instance.
      Specified by:
        `distributionForInstance` in interface `weka.classifiers.Classifier`
      Overrides:
        `distributionForInstance` in class `weka.classifiers.AbstractClassifier`
      Parameters:
        `i` - the instance to be classified
      Returns:
        predicted class probability distribution
      Throws:
        `java.lang.Exception` - if instance could not be classified successfully.

    - #### listOptions

          public java.util.Enumeration<weka.core.Option> listOptions()

      Gets an enumeration describing the available options.
      Specified by:
        `listOptions` in interface `weka.core.OptionHandler`
      Overrides:
        `listOptions` in class `weka.classifiers.AbstractClassifier`
      Returns:
        an enumeration of all the available options.

    - #### getOptions

          public java.lang.String[] getOptions()

      Returns the options of the current setup.
      Specified by:
        `getOptions` in interface `weka.core.OptionHandler`
      Overrides:
        `getOptions` in class `weka.classifiers.AbstractClassifier`
      Returns:
        the current options

    - #### setOptions

          public void setOptions(java.lang.String[] options)
                          throws java.lang.Exception

      Set the options for the current setup.
      Specified by:
        `setOptions` in interface `weka.core.OptionHandler`
      Overrides:
        `setOptions` in class `weka.classifiers.AbstractClassifier`
      Parameters:
        `options` - the new options
      Throws:
        `java.lang.Exception`

    - #### setSeed

          public void setSeed(int s)

      Set the random seed.
      Parameters:
        `s` - The random seed.

    - #### getSeed

          public int getSeed()

      Get the random seed.
      Returns:
        The random seed.

    - #### seedTipText

          public java.lang.String seedTipText()

      Returns the tip text for this property.
      Returns:
        tip text for this property

    - #### setParallelRuns

          public void setParallelRuns(int n)

      Set the number of parallel runs.
      Parameters:
        `n` - The number of parallel runs.

    - #### getParallelRuns

          public int getParallelRuns()

      Get the number of runs to do in parallel.
      Returns:
        The number of parallel runs.

    - #### parallelRunsTipText

          public java.lang.String parallelRunsTipText()

      Returns the tip text for this property.
      Returns:
        tip text for this property

    - #### setMetric

          public void setMetric(weka.classifiers.meta.AutoWEKAClassifier.Metric m)

      Set the metric.
      Parameters:
        `m` - The metric.

    - #### getMetric

          public weka.classifiers.meta.AutoWEKAClassifier.Metric getMetric()

      Get the metric.
      Returns:
        The metric.

    - #### metricTipText

          public java.lang.String metricTipText()

      Returns the tip text for this property.
      Returns:
        tip text for this property

    - #### setTimeLimit

          public void setTimeLimit(int tl)

      Set the time limit.
      Parameters:
        `tl` - The time limit in minutes.

    - #### getTimeLimit

          public int getTimeLimit()

      Get the time limit.
      Returns:
        The time limit in minutes.

    - #### timeLimitTipText

          public java.lang.String timeLimitTipText()

      Returns the tip text for this property.
      Returns:
        tip text for this property

    - #### setMemLimit

          public void setMemLimit(int ml)

      Set the memory limit.
      Parameters:
        `ml` - The memory limit in MiB.

    - #### getMemLimit

          public int getMemLimit()

      Get the memory limit.
      Returns:
        The memory limit in MiB.

    - #### memLimitTipText

          public java.lang.String memLimitTipText()

      Returns the tip text for this property.
      Returns:
        tip text for this property

    - #### setnBestConfigs

          public void setnBestConfigs(int nbc)

      Set the amount of configurations that will be given as output
      Parameters:
        `nbc` - The amount of best configurations desired by the user

    - #### getnBestConfigs

          public int getnBestConfigs()

      Get the memory limit.
      Returns:
        The amount of best configurations that will be given as output

    - #### nBestConfigsTipText

          public java.lang.String nBestConfigsTipText()

      Returns the tip text for this property.
      Returns:
        tip text for this property

    - #### setLog

          public void setLog(weka.gui.Logger log)

      Set the WEKA logger. Used for providing feedback during execution.
      Parameters:
        `log` - The logger.

    - #### getCapabilities

          public weka.core.Capabilities getCapabilities()

      Returns default capabilities of the classifier.
      Specified by:
        `getCapabilities` in interface `weka.classifiers.Classifier`
      Specified by:
        `getCapabilities` in interface `weka.core.CapabilitiesHandler`
      Overrides:
        `getCapabilities` in class `weka.classifiers.AbstractClassifier`
      Returns:
        the capabilities of this classifier

    - #### getTechnicalInformation

          public weka.core.TechnicalInformation getTechnicalInformation()

      Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
      Returns:
        the technical information about this class

    - #### globalInfo

          public java.lang.String globalInfo()

      This will return a string describing the classifier.
      Returns:
        The string.

    - #### toString

          public java.lang.String toString()

      This will return a string describing the classifier.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        The string.

    - #### measureEstimatedMetricValue

          public double measureEstimatedMetricValue()

      Returns the metric value estimated during Auto-WEKA's internal evaluation.
      Returns:
        The estimated metric value.

    - #### enumerateMeasures

          public java.util.Enumeration enumerateMeasures()

      Returns an enumeration of the additional measure names
      Specified by:
        `enumerateMeasures` in interface `weka.core.AdditionalMeasureProducer`
      Returns:
        an enumeration of the measure names

    - #### getMeasure

          public double getMeasure(java.lang.String additionalMeasureName)

      Returns the value of the named measure
      Specified by:
        `getMeasure` in interface `weka.core.AdditionalMeasureProducer`
      Parameters:
        `additionalMeasureName` - the name of the measure to query for its value
      Returns:
        the value of the named measure
      Throws:
        `java.lang.IllegalArgumentException` - if the named measure is not supported