jncc20
Class Jncc.ResultsReporter

java.lang.Object
  extended by jncc20.Jncc.ResultsReporter
Enclosing class:
Jncc

private static class Jncc.ResultsReporter
extends java.lang.Object

Helper class for jncc, which accomplishes the following tasks: reads the temporary file where NBC and NCC predictions are stored; computes performances indexes; produces the output file, which reports both the discretization log (i.e., whether some numerical feats have been discretized into a single bin) and the classifiers results.


Field Summary
private  java.util.ArrayList<java.lang.String> classNames
          Names of the output class.
private  int[] discretizationLog
          How many times each feature has been discretized in a single bin, over the different training/testing experiments.
private  java.util.ArrayList<java.lang.String> featureNames
          Names of input features
private  java.lang.String indicatorsFile
          Temporary file, where the performance indicators are saved fold-by-fold
private  int[][] nbcConfusionMatrix
          NBCconfusionMatrix, as parsed from the prediction file
private  int[][] nccConfusionMatrix
          NCCconfusionMatrix, as parsed from the prediction file
private  int numCVRuns
           
private  int numFolds
           
private  int numRuns
          how many training/testing experiments (1 for testing, num runs*num folds for CV) the predictions saved to file reg
private  java.lang.String predictionsFile
          Where to look for predictions saved to file
private  java.lang.String resultsFile
           
private  java.lang.String workingPath
           
 
Constructor Summary
Jncc.ResultsReporter(int[] SuppliedDiscretizationLog, java.lang.String suppliedResultsFile, java.util.ArrayList<java.lang.String> suppliedFeatureNames, java.util.ArrayList<java.lang.String> suppliedClassNames, java.lang.String suppliedPredictionsFile, java.lang.String suppliedWorkingPath, int suppliedNumFolds, int suppliedNumCVRuns)
          Constructor
 
Method Summary
(package private)  void analyzePredictionsFileNbcNcc()
          Computes statistics accuracy of NBC and NCC, by analyzing the predictions saved on a temporary file; then, saves the file the computed indicators and deletes the temporary file.
(package private)  void writeDiscretizationLog(int totalExp)
          Writes to the output file how many times the different variables have been discretized into a single bin, out of the total number of performed experiments.
(package private)  void writeStatsToFile()
          Parses the (temporary) file where the performance indicator have been stored fold by fold, and outputs to file the report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classNames

private java.util.ArrayList<java.lang.String> classNames
Names of the output class.


discretizationLog

private int[] discretizationLog
How many times each feature has been discretized in a single bin, over the different training/testing experiments.


featureNames

private java.util.ArrayList<java.lang.String> featureNames
Names of input features


indicatorsFile

private java.lang.String indicatorsFile
Temporary file, where the performance indicators are saved fold-by-fold


nbcConfusionMatrix

private int[][] nbcConfusionMatrix
NBCconfusionMatrix, as parsed from the prediction file


nccConfusionMatrix

private int[][] nccConfusionMatrix
NCCconfusionMatrix, as parsed from the prediction file


numCVRuns

private int numCVRuns

numFolds

private int numFolds

numRuns

private int numRuns
how many training/testing experiments (1 for testing, num runs*num folds for CV) the predictions saved to file reg


predictionsFile

private java.lang.String predictionsFile
Where to look for predictions saved to file


resultsFile

private java.lang.String resultsFile

workingPath

private java.lang.String workingPath
Constructor Detail

Jncc.ResultsReporter

Jncc.ResultsReporter(int[] SuppliedDiscretizationLog,
                     java.lang.String suppliedResultsFile,
                     java.util.ArrayList<java.lang.String> suppliedFeatureNames,
                     java.util.ArrayList<java.lang.String> suppliedClassNames,
                     java.lang.String suppliedPredictionsFile,
                     java.lang.String suppliedWorkingPath,
                     int suppliedNumFolds,
                     int suppliedNumCVRuns)
Constructor

Method Detail

analyzePredictionsFileNbcNcc

void analyzePredictionsFileNbcNcc()
Computes statistics accuracy of NBC and NCC, by analyzing the predictions saved on a temporary file; then, saves the file the computed indicators and deletes the temporary file. The file is expected to be made up by many rows arranged as follows:

FoldNumber | FEATURES(m columns) | Actual Class (1 col) | NBC prediction (1 col) | NCC prediction (nc cols)

where m is the number of features of the data set, and nc is the number of classes. The function properly manages the fact that in different runs of CV the number of features can be different, because of the discretization (i.e., in some runs, some features might be discretized into a unique bin).


writeDiscretizationLog

void writeDiscretizationLog(int totalExp)
Writes to the output file how many times the different variables have been discretized into a single bin, out of the total number of performed experiments.


writeStatsToFile

void writeStatsToFile()
Parses the (temporary) file where the performance indicator have been stored fold by fold, and outputs to file the report. Standard deviation is empirically computed between the folds.