public abstract class Algorithm
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
correct
Number of correctly classified example from training dataset.
|
protected static java.io.BufferedWriter |
log
Log buffer.
|
protected Dataset |
modelDataset
Model dataset.
|
protected static java.lang.String |
modelFileName
File's name which contains all the information needed to build the model.
|
protected static java.lang.String |
resultFileName
Results file's name.
|
protected long |
startTime
Starting time of the execution.
|
protected int |
testCorrect
Number of correctly classified example from test dataset.
|
protected Dataset |
testDataset
Test dataset.
|
protected static java.lang.String |
testFileName
Test dataset file's name.
|
protected static java.lang.String |
testOutputFileName
Name of the test output file.
|
protected Dataset |
trainDataset
Training dataset.
|
protected static java.lang.String |
trainFileName
Training dataset file's name.
|
protected static java.lang.String |
trainOutputFileName
Name of the training output file.
|
Constructor and Description |
---|
Algorithm() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getHeader()
Function to get the name of the relation and the names, types and possible values of every attribute in
a dataset.
|
protected void |
initTokenizer(java.io.StreamTokenizer tokenizer)
Function to initialize the stream tokenizer.
|
protected abstract void |
printResult()
Evaluates the algorithm and writes the results in the file.
|
protected abstract void |
printTest()
Evaluates the test dataset and writes the results in the file.
|
protected abstract void |
printTrain()
Evaluates the training dataset and writes the results in the file.
|
protected abstract void |
setOptions(java.io.StreamTokenizer options)
Function to read the options from the execution file and assign the values to the parameters.
|
protected static java.lang.String modelFileName
protected static java.lang.String trainFileName
protected static java.lang.String testFileName
protected static java.lang.String trainOutputFileName
protected static java.lang.String testOutputFileName
protected static java.lang.String resultFileName
protected int correct
protected int testCorrect
protected Dataset modelDataset
protected Dataset trainDataset
protected Dataset testDataset
protected static java.io.BufferedWriter log
protected long startTime
protected void initTokenizer(java.io.StreamTokenizer tokenizer)
tokenizer
- The tokenizer.protected java.lang.String getHeader()
protected abstract void setOptions(java.io.StreamTokenizer options) throws java.lang.Exception
options
- The StreamTokenizer that reads the parameters file.java.lang.Exception
- If the format of the file is not correct.protected abstract void printResult() throws java.io.IOException
java.io.IOException
- If the file cannot be written.protected abstract void printTest() throws java.io.IOException
java.io.IOException
- If the file cannot be written.protected abstract void printTrain() throws java.io.IOException
java.io.IOException
- If the file cannot be written.