util.results
Class CrossValidationResult

java.lang.Object
  extended by util.results.CrossValidationResult

public class CrossValidationResult
extends java.lang.Object

This class contains the normal results of a crossvalidation (number of false positives/false negatives/true positives/true negatives and the distances and labels of the results). From here on all other results are extracted from this data. The memeory usage should not be a problem, since only 4 arrays of fixed size are used (say 10000 training examples --> 4 * 8 * 10000 bytes = 320 kb).

Author:
Michiel Van Bel

Constructor Summary
CrossValidationResult()
          Creates a CrossValidationResult object.
 
Method Summary
 void compute_roc()
          computes the roc-curve data from the distances and labels that are provided.
 void computeDeductedData()
          This method computes all the other results, following the given basic data of the false positives/true positives/...
 double getAccuracy()
          Returns the accuracy of the crossvalidation
 double getAccuracy2()
          Returns another accuracy measurement
 double getApproximate_correlation()
          Returns the approximate correlation
 double getAuc()
          Returns the area under the roc-curve (a measurement for the performance of a classifier).
 double getCorrelation_coefficient()
          Returns the correlation coefficient of the crossvalidation
 double[] getDistances()
           
 double getError_rate()
          Returns the error rate of the crossvalidation
 double getF1_measure()
          Returns the F1-measure of the crossvalidation (f1-measure is the harmonic means of sensitivity and specificity)
 int getFalseNegatives()
          Returns the amount of false negatives of the crossvalidation
 int getFalsePositives()
          Returns the amount of false positives of the crossvalidation
 double getFp_rate()
          Returns the false positive rate of the crossvalidation
 double getFp5_measure()
          Returns the FP5% measure from the crossvalidation
 double[] getLabels()
           
 double getMeanSquaredError()
          Returns the mean squared error of the crossvalidation
 double[] getRoc_fp_rate()
          Returns the false positive rate for the roc curve
 double[] getRoc_tp_rate()
          Returns the true positive rate for the roc curve
 double getSensitivity()
          Returns the sensitivity of the crossvalidation
 double getSpecificity()
          Returns the specificity of the crossvalidation
 double getSquaredCorrelationCoefficient()
          Returns the squared correlation coefficient of the crossvalidation
 int getTotalNegatives()
          Returns the amount of total negatives
 int getTotalPositives()
          Returns the total amount of positives
 int getTrueNegatives()
          Returns the amount of true negatives
 int getTruePositives()
          Returns the amount of true positives
 void setAccuracy(double accuracy)
           
 void setAccuracy2(double accuracy2)
           
 void setApproximate_correlation(double approximate_correlation)
           
 void setAuc(double auc)
           
 void setCorrelation_coefficient(double correlation_coefficient)
           
 void setDistances(double[] distances)
          Sets the distancesto the hyperplane for all training examples
 void setError_rate(double error_rate)
           
 void setF1_measure(double f1_measure)
           
 void setFalseNegatives(int falseNegatives)
          Sets the amount of false negatives of the crossvalidation
 void setFalsePositives(int falsePositives)
          Sets the amount of false positives
 void setFp_rate(double fp_rate)
           
 void setFp5_measure(double fp5_measure)
           
 void setLabels(double[] labels)
          Sets the labels (1/-1 for positive/negative) for all the training examples.
 void setMeanSquaredError(double meanSquaredError)
           
 void setRoc_fp_rate(double[] roc_fp_rate)
           
 void setRoc_tp_rate(double[] roc_tp_rate)
           
 void setSensitivity(double sensitivity)
           
 void setSpecificity(double specificity)
           
 void setSquaredCorrelationCoefficient(double squaredCorrelationCoefficient)
           
 void setTotalNegatives(int totalNegatives)
          Sets the total amount of negatives
 void setTotalPositives(int totalPositives)
          Sets the total amount of positives
 void setTrueNegatives(int trueNegatives)
          Sets the amount of true negatives
 void setTruePositives(int truePositives)
          Sets the amount of true positives
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrossValidationResult

public CrossValidationResult()
Creates a CrossValidationResult object. No data values are initialized. All data should be set by the applicable setter-methods

Method Detail

computeDeductedData

public void computeDeductedData()
This method computes all the other results, following the given basic data of the false positives/true positives/... This includes for example correlation coefficient, f_1 measure, etc. This method should be called independently since there is no direct way of knowing when all the variables have been set.


compute_roc

public void compute_roc()
computes the roc-curve data from the distances and labels that are provided.


getAccuracy

public double getAccuracy()
Returns the accuracy of the crossvalidation

Returns:
The accuracy of the crossvalidation

getMeanSquaredError

public double getMeanSquaredError()
Returns the mean squared error of the crossvalidation

Returns:
The mean squared error of the crossvalidation

getSquaredCorrelationCoefficient

public double getSquaredCorrelationCoefficient()
Returns the squared correlation coefficient of the crossvalidation

Returns:
The squared correlation coefficient of the crossvalidation

getFalseNegatives

public int getFalseNegatives()
Returns the amount of false negatives of the crossvalidation

Returns:
The amount of false negatives of the crossvalidation

setFalseNegatives

public void setFalseNegatives(int falseNegatives)
Sets the amount of false negatives of the crossvalidation

Parameters:
falseNegatives - The new amount of false negatives

getFalsePositives

public int getFalsePositives()
Returns the amount of false positives of the crossvalidation

Returns:
The amount of false positives of the crossvalidation

setFalsePositives

public void setFalsePositives(int falsePositives)
Sets the amount of false positives

Parameters:
falsePositives - The new amount of false positives

getTrueNegatives

public int getTrueNegatives()
Returns the amount of true negatives

Returns:
The amount of true negatives

setTrueNegatives

public void setTrueNegatives(int trueNegatives)
Sets the amount of true negatives

Parameters:
trueNegatives - The new amount of true negatives

getTruePositives

public int getTruePositives()
Returns the amount of true positives

Returns:
The amount of true positives

setTruePositives

public void setTruePositives(int truePositives)
Sets the amount of true positives

Parameters:
truePositives - The new amount of true positives

getTotalNegatives

public int getTotalNegatives()
Returns the amount of total negatives

Returns:
The total amount of negatives

setTotalNegatives

public void setTotalNegatives(int totalNegatives)
Sets the total amount of negatives

Parameters:
totalNegatives - The total amount of negatives

getTotalPositives

public int getTotalPositives()
Returns the total amount of positives

Returns:
The total amount of positves

setTotalPositives

public void setTotalPositives(int totalPositives)
Sets the total amount of positives

Parameters:
totalPositives - The new total amount of positives

getAccuracy2

public double getAccuracy2()
Returns another accuracy measurement

Returns:
Accuracy measurement

getApproximate_correlation

public double getApproximate_correlation()
Returns the approximate correlation

Returns:
The approximate correlation

getCorrelation_coefficient

public double getCorrelation_coefficient()
Returns the correlation coefficient of the crossvalidation

Returns:
The correlation coefficient of the crossvalidation

getError_rate

public double getError_rate()
Returns the error rate of the crossvalidation

Returns:
The error rate of the crossvalidation

getSensitivity

public double getSensitivity()
Returns the sensitivity of the crossvalidation

Returns:
The sensitivity of the crossvalidation

getSpecificity

public double getSpecificity()
Returns the specificity of the crossvalidation

Returns:
The specificity of the crossvalidation

getFp_rate

public double getFp_rate()
Returns the false positive rate of the crossvalidation

Returns:
The false positive rate of the crossvalidation

getF1_measure

public double getF1_measure()
Returns the F1-measure of the crossvalidation (f1-measure is the harmonic means of sensitivity and specificity)

Returns:
The f1-measure of the crossvalidation

setDistances

public void setDistances(double[] distances)
Sets the distancesto the hyperplane for all training examples

Parameters:
distances - The distances of the crossvalidaded trainingexamples

setLabels

public void setLabels(double[] labels)
Sets the labels (1/-1 for positive/negative) for all the training examples. These labels are the original known labels.

Parameters:
labels - The labels of the training examples.

getRoc_fp_rate

public double[] getRoc_fp_rate()
Returns the false positive rate for the roc curve

Returns:
the false positive rate for the roc curve

getRoc_tp_rate

public double[] getRoc_tp_rate()
Returns the true positive rate for the roc curve

Returns:
the true positive rate for the roc curve

getFp5_measure

public double getFp5_measure()
Returns the FP5% measure from the crossvalidation

Returns:
The FP5% measure

getAuc

public double getAuc()
Returns the area under the roc-curve (a measurement for the performance of a classifier).

Returns:
The area under the roc-curve

getDistances

public double[] getDistances()

getLabels

public double[] getLabels()

setAccuracy

public void setAccuracy(double accuracy)

setAccuracy2

public void setAccuracy2(double accuracy2)

setApproximate_correlation

public void setApproximate_correlation(double approximate_correlation)

setAuc

public void setAuc(double auc)

setCorrelation_coefficient

public void setCorrelation_coefficient(double correlation_coefficient)

setError_rate

public void setError_rate(double error_rate)

setF1_measure

public void setF1_measure(double f1_measure)

setFp_rate

public void setFp_rate(double fp_rate)

setFp5_measure

public void setFp5_measure(double fp5_measure)

setMeanSquaredError

public void setMeanSquaredError(double meanSquaredError)

setRoc_fp_rate

public void setRoc_fp_rate(double[] roc_fp_rate)

setRoc_tp_rate

public void setRoc_tp_rate(double[] roc_tp_rate)

setSensitivity

public void setSensitivity(double sensitivity)

setSpecificity

public void setSpecificity(double specificity)

setSquaredCorrelationCoefficient

public void setSquaredCorrelationCoefficient(double squaredCorrelationCoefficient)