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 DataSetgetTestingSet()Returns the testing set of this train/test set.DataSetgetTrainingSet()Returns the training set of this train/test set.voidsetOptions(java.lang.String[] options)Sets the options for this train/test set.voidsetTestingSet(DataSet test)Sets the testing set of this train/test set to the specified data set.voidsetTrainingSet(DataSet train)Sets the training set of this train/test set to the specified data set.java.lang.StringtoString()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.ExceptionSets the options for this train/test set. The-toption loads the data set with the specified file name as the training set. The-Toption loads the data set with the specified file name as the testing set.- Specified by:
setOptionsin 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:
toStringin classjava.lang.Object- Returns:
- a string containing the attributes information and examples
-
-