public abstract class Algorithm
extends java.lang.Object
Abstract class that contains the basic structures to implements Rule learining algorithms.
Modifier and Type | Field and Description |
---|---|
protected int |
correct
Correctly classified itemsets.
|
protected static java.io.BufferedWriter |
log
The log file.
|
protected Dataset |
modelDataset
The model dataset.
|
protected static java.lang.String |
modelFileName
The name of the file that contains the information to build the model.
|
protected static java.lang.String |
resultFileName
The name of the result file.
|
protected long |
startTime
The instant of starting the algorithm.
|
protected int |
testCorrect
Correctly classified in test.
|
protected Dataset |
testDataset
The test dataset.
|
protected static java.lang.String |
testFileName
The name of the file that contains the information to make the test.
|
protected static java.lang.String |
testOutputFileName
The name of the test output file.
|
protected Dataset |
trainDataset
The train dataset.
|
protected static java.lang.String |
trainFileName
The name of the file that contains the information to make the training.
|
protected static java.lang.String |
trainOutputFileName
The name of the train 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.