autoweka
Class InstanceGenerator

java.lang.Object
  extended by 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
static class InstanceGenerator.NestedArgs
          Struct for dealing with nested args on InstanceGenerators that are chained together.
 
Constructor Summary
InstanceGenerator(InstanceGenerator generator)
          Clones an InstanceGenerator from another
InstanceGenerator(Instances training, 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
abstract  Instances _getTestingFromParams(java.lang.String params)
          Subclass implementation for getting the testing data given the param string
abstract  Instances _getTrainingFromParams(java.lang.String params)
          Subclass implementation for getting the training data given the param string
static InstanceGenerator create(java.lang.String className, Instances training, 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.
 Instances getTesting()
          Gets a copy of the testing data
 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
 Instances getTraining()
          Gets a copy of the training data
 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


InstanceGenerator

public InstanceGenerator(Instances training,
                         Instances testing)
Build an instance generator from the given training and testing data


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'

Method Detail

getTrainingFromParams

public final 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


getTestingFromParams

public final 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


_getTrainingFromParams

public abstract Instances _getTrainingFromParams(java.lang.String params)
Subclass implementation for getting the training data given the param string


_getTestingFromParams

public abstract Instances _getTestingFromParams(java.lang.String params)
Subclass implementation for getting the testing data given the param string


getTraining

public Instances getTraining()
Gets a copy of the training data


getTesting

public Instances getTesting()
Gets a copy of the testing data


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


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


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


create

public static InstanceGenerator create(java.lang.String className,
                                       Instances training,
                                       Instances testing)
Creates an instance of an InstanceGenerator given a class name, training data and the testing data