at.tuwien.ifs.somtoolbox.data
Class SOMLibRegressInformation

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.data.SOMLibRegressInformation

public class SOMLibRegressInformation
extends Object

This class provides information about the real output value for the InputData input vectors.

The file format consists of a header and the content as follows:

$TYPE string, mandatory. Fixed to output_information.
$XDIM integer, mandatory: number of units in x-direction.
$YDIM integer, mandatory: dimensionality of the regression file, equals the number of input vectors ( InputData.numVectors()).
labelName_n outputValue

Alternatively, the file format can be more simple, and not contain any file header. Then, there is only a list of lines with two tabulator-separated Strings in the form of labelName regressionValue.

Version:
$Id: SOMLibRegressInformation.java 3583 2010-05-21 10:07:41Z mayer $
Author:
Rudolf Mayer

Field Summary
private  LinkedHashMap<String,Double> dataHash
           
private static Logger logger
           
private  double maxPrediction
           
private  double meanPrediction
           
private  double minPrediction
           
private  String regressionInformationFileName
          The file name to read from.
 
Constructor Summary
SOMLibRegressInformation(String regressionInformationFileName)
          Creates a new class information object by trying to read the given file in both the versions with a file header ( readSOMLibRegressionInformationFile()) and the tab separated file ( SOMLibClassInformation.readTabSepClassInformationFile()).
 
Method Summary
 void computeStats()
           
 double getMaxPrediction()
           
 double getMeanPrediction()
           
 double getMinPrediction()
           
 double getPrediction(String vectorname)
           
private  void readSOMLibRegressionInformationFile()
          Reads a regression information file containing a header and class indices.
private  void readTabSepRegressionInformationFile()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final Logger logger

regressionInformationFileName

private String regressionInformationFileName
The file name to read from.


dataHash

private LinkedHashMap<String,Double> dataHash

maxPrediction

private double maxPrediction

minPrediction

private double minPrediction

meanPrediction

private double meanPrediction
Constructor Detail

SOMLibRegressInformation

public SOMLibRegressInformation(String regressionInformationFileName)
                         throws SOMToolboxException
Creates a new class information object by trying to read the given file in both the versions with a file header ( readSOMLibRegressionInformationFile()) and the tab separated file ( SOMLibClassInformation.readTabSepClassInformationFile()).

Throws:
SOMToolboxException
Method Detail

readSOMLibRegressionInformationFile

private void readSOMLibRegressionInformationFile()
                                          throws IOException,
                                                 SOMToolboxException
Reads a regression information file containing a header and class indices.

Throws:
IOException
SOMToolboxException

readTabSepRegressionInformationFile

private void readTabSepRegressionInformationFile()
                                          throws SOMToolboxException,
                                                 IOException
Throws:
SOMToolboxException
IOException

computeStats

public void computeStats()

getPrediction

public double getPrediction(String vectorname)

getMaxPrediction

public double getMaxPrediction()
Returns:
Returns the maximum prediction value

getMeanPrediction

public double getMeanPrediction()
Returns:
Returns the mean prediction value

getMinPrediction

public double getMinPrediction()
Returns:
Returns the minimum prediction value