autoweka

## Class InstanceGenerator

- java.lang.Object
- - autoweka.InstanceGenerator

- Direct Known Subclasses:
    CrossValidation, Default, RandomSubSampling

      public abstract class InstanceGenerator
      extends java.lang.Object

  Abstract class for partitioning a dataset (consisting of training and testing data) into 'instances' that are given to the SMBO method

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `InstanceGenerator.NestedArgs` Struct for dealing with nested args on InstanceGenerators that are chained together.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InstanceGenerator(InstanceGenerator generator)` Clones an InstanceGenerator from another
    `InstanceGenerator(weka.core.Instances training, weka.core.Instances testing)` Build an instance generator from the given training and testing data
    `InstanceGenerator(java.lang.String datasetString)` Builds an InstanceGenerator from a datasetFileName, ie a zip file containing exactly two files, 'train.arff' and 'test.arff'

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract weka.core.Instances` | `_getTestingFromParams(java.lang.String params)`
    `abstract weka.core.Instances` | `_getTrainingFromParams(java.lang.String params)`
    `static InstanceGenerator` | `create(java.lang.String className, weka.core.Instances training, weka.core.Instances testing)` Creates an instance of an InstanceGenerator given a class name, training data and the testing data
    `static InstanceGenerator` | `create(java.lang.String className, java.lang.String datasetFileName)` Creates an instance of an InstanceGenerator given a class name and the datasetFileName
    `java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>` | `getAllInstanceFeatures(java.lang.String params)` Some SMBO methods can leverage extra features about an Instance, this method should return a map of feature/value pairs for all instances
    `abstract java.util.List<java.lang.String>` | `getAllInstanceStrings(java.lang.String params)` Gets a list of all the 'params' Strings that can be used with this InstanceGenerator.
    `weka.core.Instances` | `getTesting()` Gets a copy of the testing data
    `weka.core.Instances` | `getTestingFromParams(java.lang.String params)` Given a parameter string (generally in the form of a property string), get the testing data; if params is 'default', then this method returns the raw testing data
    `weka.core.Instances` | `getTraining()` Gets a copy of the training data
    `weka.core.Instances` | `getTrainingFromParams(java.lang.String params)` Given a parameter string (generally in the form of a property string), get the training data; if params is 'default', then this method returns the raw training data

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

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

- - ### Constructor Detail

    - #### InstanceGenerator

          public InstanceGenerator(InstanceGenerator generator)

      Clones an InstanceGenerator from another
      Parameters:
        `generator` - The instance generator.

    - #### InstanceGenerator

          public InstanceGenerator(weka.core.Instances training,
                                   weka.core.Instances testing)

      Build an instance generator from the given training and testing data
      Parameters:
        `training` - The training instances.
        `testing` - The testing instances.

    - #### InstanceGenerator

          public InstanceGenerator(java.lang.String datasetString)

      Builds an InstanceGenerator from a datasetFileName, ie a zip file containing exactly two files, 'train.arff' and 'test.arff'
      Parameters:
        `datasetString` - The string the describing the dataset.

  - ### Method Detail

    - #### getTrainingFromParams

          public final weka.core.Instances getTrainingFromParams(java.lang.String params)

      Given a parameter string (generally in the form of a property string), get the training data; if params is 'default', then this method returns the raw training data
      Parameters:
        `params` - The parameter string.
      Returns:
        The training instances.

    - #### getTestingFromParams

          public final weka.core.Instances getTestingFromParams(java.lang.String params)

      Given a parameter string (generally in the form of a property string), get the testing data; if params is 'default', then this method returns the raw testing data
      Parameters:
        `params` - The parameter string.
      Returns:
        The testing instances.

    - #### _getTrainingFromParams

          public abstract weka.core.Instances _getTrainingFromParams(java.lang.String params)

    - #### _getTestingFromParams

          public abstract weka.core.Instances _getTestingFromParams(java.lang.String params)

    - #### getTraining

          public weka.core.Instances getTraining()

      Gets a copy of the training data
      Returns:
        The training instances.

    - #### getTesting

          public weka.core.Instances getTesting()

      Gets a copy of the testing data
      Returns:
        The testing instances.

    - #### getAllInstanceStrings

          public abstract java.util.List<java.lang.String> getAllInstanceStrings(java.lang.String params)

      Gets a list of all the 'params' Strings that can be used with this InstanceGenerator. For example, the for 10-fold Cross Validation this method would return 10 Strings defining each fold
      Parameters:
        `params` - The parameters.
      Returns:
        The list of parameters.

    - #### getAllInstanceFeatures

          public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getAllInstanceFeatures(java.lang.String params)

      Some SMBO methods can leverage extra features about an Instance, this method should return a map of feature/value pairs for all instances
      Parameters:
        `params` - The parameters.
      Returns:
        The map of feature/value pairs.

    - #### create

          public static InstanceGenerator create(java.lang.String className,
                                                 java.lang.String datasetFileName)

      Creates an instance of an InstanceGenerator given a class name and the datasetFileName
      Parameters:
        `className` - The name of the class.
        `datasetFileName` - The name of the dataset file.
      Returns:
        The instance generator.

    - #### create

          public static InstanceGenerator create(java.lang.String className,
                                                 weka.core.Instances training,
                                                 weka.core.Instances testing)

      Creates an instance of an InstanceGenerator given a class name, training data and the testing data
      Parameters:
        `className` - The name of the class.
        `training` - The training instances.
        `testing` - The testing instances.
      Returns:
        The instance generator.