Class TrainTestSets
- java.lang.Object
-
- 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.
-
-
Constructor Summary
Constructors Constructor Description TrainTestSets()
Default constructor.TrainTestSets(DataSet train, DataSet test)
Explicit constructor that sets the training and testing sets to the specified data sets.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataSet
getTestingSet()
Returns the testing set of this train/test set.DataSet
getTrainingSet()
Returns the training set of this train/test set.void
setOptions(java.lang.String[] options)
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.
-
-
-
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)
Sets the testing set of this train/test set to the specified data set.- Parameters:
test
- the specified testing set
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.Exception
Sets the options for this train/test set. The-t
option loads the data set with the specified file name as the training set. The-T
option loads the data set with the specified file name as the testing set.- Specified by:
setOptions
in interfaceOptionHandler
- Parameters:
options
- the arguments- Throws:
java.lang.Exception
- if the file is not found or if a parsing 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 classjava.lang.Object
- Returns:
- a string containing the attributes information and examples
-
-