cosc575.p1
Class TrainTestSets

java.lang.Object
  extended by cosc575.p1.TrainTestSets
All Implemented Interfaces:
OptionHandler

public class TrainTestSets
extends java.lang.Object
implements OptionHandler

Implements a class for storing training and testing sets for machine-learning methods.


Field Summary
protected  DataSet test
          the testing examples
protected  DataSet train
          the training examples
 
Constructor Summary
TrainTestSets()
          Default constructor.
TrainTestSets(DataSet train, DataSet test)
          Explicit constructor that sets the training and testing sets to the specified data sets.
TrainTestSets(java.lang.String[] args)
          Explicit constructor that processes the specified arguments.
 
Method Summary
 DataSet getTestingSet()
          Returns the testing set of this train/test set.
 DataSet getTrainingSet()
          Returns the training set of this train/test set.
static void main(java.lang.String[] args)
           
 void setOptions(java.lang.String[] args)
          Sets the options for this train/test set.
 void setTestingSet(DataSet test)
          Sets the testing set of this train/test set to the specified data set.
 void setTrainingSet(DataSet train)
          Sets the training set of this train/test set to the specified data set.
 java.lang.String toString()
          Returns a string representation of this train/test set in a format similar to that of the file format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

train

protected DataSet train
the training examples


test

protected DataSet test
the testing examples

Constructor Detail

TrainTestSets

public TrainTestSets()
Default constructor.


TrainTestSets

public TrainTestSets(java.lang.String[] args)
              throws java.lang.Exception
Explicit constructor that processes the specified arguments.

Parameters:
args - the arguments for this train/test set
Throws:
java.lang.Exception - if an exception occurs

TrainTestSets

public TrainTestSets(DataSet train,
                     DataSet test)
              throws java.lang.Exception
Explicit constructor that sets the training and testing sets to the specified data sets.

Parameters:
train - the training set
test - the testing set
Throws:
java.lang.Exception - if an exception occurs
Method Detail

getTrainingSet

public DataSet getTrainingSet()
Returns the training set of this train/test set.

Returns:
a training set

getTestingSet

public DataSet getTestingSet()
Returns the testing set of this train/test set.

Returns:
a testing set

setTrainingSet

public void setTrainingSet(DataSet train)
Sets the training set of this train/test set to the specified data set.

Parameters:
train - the specified training set

setTestingSet

public void setTestingSet(DataSet test)
                   throws java.lang.Exception
Sets the testing set of this train/test set to the specified data set.

Parameters:
test - the specified testing set
Throws:
java.lang.Exception

setOptions

public void setOptions(java.lang.String[] args)
                throws java.lang.Exception
Sets the options for this train/test set.

Specified by:
setOptions in interface OptionHandler
Parameters:
args - the arguments
Throws:
java.lang.Exception - if an exception occurs

toString

public java.lang.String toString()
Returns a string representation of this train/test set in a format similar to that of the file format. Includes the testing examples if present.

Overrides:
toString in class java.lang.Object
Returns:
a string containing the attributes information and examples

main

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