public class Statistic
extends java.lang.Object
This class is used to show and configurate all the possible statistics. In the normal mode, it will generate four statistic output files: The INC file that contains the incremental results of the execution. The TRN and the TST file, that have the final result statistic of the a train o a test execution. And finally, it generates the PLT (population) file, that contains all the resulting classifiers of the execution. The statistics that will be written on that files are: iterations, number of good classifications, number of bad classifications, number of not covered classifications, total number of examples, percentage of correct classification of the covered examples, percentage of correct classifications of the whole number of examples, number of macro classifiers of the population, percentage of the optimal population that has been reached already, the percentage of generalitzation and the number of micro classifiers of the population.
Constructor and Description |
---|
Statistic()
Creates an Statistic object.
|
Modifier and Type | Method and Description |
---|---|
void |
closeFiles()
Closes all the opened files.
|
void |
makeIncStatistics(Population pop,
int iteration,
int[] executionResults)
It makes the incremental statistics.
|
void |
makeTestStatistics(Population pop,
int iteration,
int[] executionResults,
int typeOfTest)
It makes the test statistics.
|
void |
makeTimeStatistics(TimeControl tControl)
It makes the time statistics.
|
void |
makeTrainOrTestStatistics(java.io.PrintWriter f,
Population pop,
int iteration,
int[] executionResults)
It makes the train statistics.
|
void |
makeTrainStatistics(Population pop,
int iteration,
int[] executionResults)
It makes the train statistics.
|
void |
printPopulation(Population pop)
It writes the population to a file.
|
void |
printStateAndClass(double[] envState,
int action)
It prints the environmental state and the correct associated action.
|
void |
printStateAndClassNoCov(double[] envState,
int action)
It prints the environmental state and for those examples with no action.
|
void |
writeExpectedTestOut(int expected,
int current)
It writes to the test statistics file the expected out compared with the
output predicted by the system.
|
void |
writeExpectedTrainOut(int expected,
int current)
It writes to the train statistics file the expected out compared with the
output predicted by the system.
|
public Statistic()
public void makeIncStatistics(Population pop, int iteration, int[] executionResults)
It makes the incremental statistics. It will write incrementally the statistics mentioned above.
pop
- is the current population.iteration
- is the current iteration of the problem.executionResults
- is a vector that contains the results of
the window execution. In the first position it contains the number
of examples that have been correctly classified. In the second it
contains the number of failed classifications, and in the third one
the number of not covered classifications.public void makeTrainStatistics(Population pop, int iteration, int[] executionResults)
It makes the train statistics. It will write on a train statistics file the statistics mentioned above.
pop
- is the current population.iteration
- is the current iteration of the problemexecutionResults
- is a vector that contains the results of
the train execution. In the first position it contains the number
of examples that have been correctly classified. In the second it
contains the number of failed classifications, and in the third one
the number of not covered classifications.public void makeTestStatistics(Population pop, int iteration, int[] executionResults, int typeOfTest)
It makes the test statistics.
pop
- is the current population.iteration
- is the current iteration of the problemexecutionResults
- is a vector that contains the results of
the test execution. In the first position it contains the number
of examples that have been correctly classified. In the second it
contains the number of failed classifications, and in the third one
the number of not covered classifications.typeOfTest
- identify the type of test.public void makeTrainOrTestStatistics(java.io.PrintWriter f, Population pop, int iteration, int[] executionResults)
It makes the train statistics.
pop
- is the current population.iteration
- is the current iteration of the problemexecutionResults
- is a vector that contains the results of
the test execution. In the first position it contains the number
of examples that have been correctly classified. In the second it
contains the number of failed classifications, and in the third one
the number of not covered classifications.f
- is a PrintWriter of the file where the results have to be
writen.public void makeTimeStatistics(TimeControl tControl)
It makes the time statistics. It will write into a file the time wasted in training and testing the system, and the reduction algorithms time.
tControl
- is a TimeControl object that contains the times
wasted in each category
public void printPopulation(Population pop)
pop
- is the current population.public void printStateAndClass(double[] envState, int action)
envState
- is the environmental state.action
- is the correct action associated to that state.public void printStateAndClassNoCov(double[] envState, int action)
envState
- is the environmental state.action
- is the correct action associated to that state.public void writeExpectedTrainOut(int expected, int current)
It writes to the train statistics file the expected out compared with the output predicted by the system.
expected
- the expected ouptutcurrent
- the current output (the real one)public void writeExpectedTestOut(int expected, int current)
It writes to the test statistics file the expected out compared with the output predicted by the system.
expected
- the expected ouptutcurrent
- the current output (the real one)public void closeFiles()
Closes all the opened files.