Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.classifier
Class ScoreBasedPerformanceMeasureDefinitions

    java.lang.Object
      de.jstacs.classifier.ScoreBasedPerformanceMeasureDefinitions

    public class ScoreBasedPerformanceMeasureDefinitions

extends Object

This class contains the methods that are needed to evaluate a score based 2-class-classifier.

Author:
  Jens Keilwagen, Jan Grau
See Also:
  `AbstractScoreBasedClassifier`, `AbstractClassifier.evaluate(MeasureParameters, boolean, de.jstacs.data.Sample...)`, `AbstractClassifier.evaluateAll(MeasureParameters, boolean, de.jstacs.data.Sample...)`, `MeasureParameters`

Nested Class Summary
`static class` | `ScoreBasedPerformanceMeasureDefinitions.ThresholdMeasurePair` This class is used as a container that allows to store a threshold and the result of a measure together.

Constructor Summary
`ScoreBasedPerformanceMeasureDefinitions()`

Method Summary
`protected static double` | `getAUC_PR(double[] scoresClass0, double[] scoresClass1, ArrayList<double[]> list)` This method computes the area under the precision recall curve.
`protected static double` | `getAUC_ROC(double[] scoresClass0, double[] scoresClass1, ArrayList<double[]> list)` This method computes the area under the receiver operator characteristics curve.
`protected static double` | `getClassificationRateFor2Classes(double[] scoresClass0, double[] scoresClass1)` This method computes the classification rate.
`protected static ScoreBasedPerformanceMeasureDefinitions.ThresholdMeasurePair` | `getFPRForSensitivity(double[] scoresClass0, double[] scoresClass1, double sensitivity)` This method computes the false positive rate (FPR) for a given sensitivity.
`protected static ScoreBasedPerformanceMeasureDefinitions.ThresholdMeasurePair` | `getMaxOfCC(double[] scoresClass0, double[] scoresClass1)` This method computes the maximal correlation coefficient (CC_max).
`protected static double[][]` | `getPartialROC(double[] scoresClass0, double[] scoresClass1, RangeParameter specs)` This method allows to compute a partial ROC curve.
`protected static ScoreBasedPerformanceMeasureDefinitions.ThresholdMeasurePair` | `getPPVForSensitivity(double[] scoresClass0, double[] scoresClass1, double sensitivity)` This method computes the positive predictive value (PPV) for a given sensitivity.
`protected static ScoreBasedPerformanceMeasureDefinitions.ThresholdMeasurePair` | `getSensitivityForSpecificity(double[] scoresClass0, double[] scoresClass1, double specificity)` This method computes the sensitivity for a given specificity.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ScoreBasedPerformanceMeasureDefinitions

    public ScoreBasedPerformanceMeasureDefinitions()

Method Detail

### getPartialROC

    protected static double[][] getPartialROC(double[] scoresClass0,
                                              double[] scoresClass1,
                                              RangeParameter specs)
                                       throws ParameterException

  This method allows to compute a partial ROC curve.

  Parameters:
    `scoresClass0` - the scores of class 0 (have to be sorted)
    `scoresClass1` - the scores of class 1 (have to be sorted)
    `specs` - these specificities are used as grid for the partial curve
  Returns:
    a matrix
    - `m[0][i] i`-th specificity
    - `m[1][i] i`-th sensitivity
    - `m[2][i] i`-th threshold
  Throws:
    `ParameterException` - if the method `RangeParameter.next()` throws one

### getAUC_PR

    protected static double getAUC_PR(double[] scoresClass0,
                                      double[] scoresClass1,
                                      ArrayList<double[]> list)

  This method computes the area under the precision recall curve. It also enables the user to compute the complete curve so that it can be used for plotting. If you like to get the curve, you should use an empty `ArrayList` for `list`, otherwise use `null`.

  Parameters:
    `scoresClass0` - the scores of class 0 (have to be sorted)
    `scoresClass1` - the scores of class 1 (have to be sorted)
    `list` - `null` or an empty list
  Returns:
    the area under the precision recall curve

### getAUC_ROC

    protected static double getAUC_ROC(double[] scoresClass0,
                                       double[] scoresClass1,
                                       ArrayList<double[]> list)

  This method computes the area under the receiver operator characteristics curve. It also enables the user to compute the complete curve so that it can be used for plotting. If you like to get the curve, you should use an empty `ArrayList` for `list`, otherwise use `null`.

  Parameters:
    `scoresClass0` - the scores of class 0 (have to be sorted)
    `scoresClass1` - the scores of class 1 (have to be sorted)
    `list` - `null` or an empty list
  Returns:
    the area under the receiver operator characteristics curve

### getFPRForSensitivity

    protected static ScoreBasedPerformanceMeasureDefinitions.ThresholdMeasurePair getFPRForSensitivity(double[] scoresClass0,
                                                                                                       double[] scoresClass1,
                                                                                                       double sensitivity)
                                                                                                throws IllegalArgumentException

  This method computes the false positive rate (FPR) for a given sensitivity.

  Parameters:
    `scoresClass0` - the scores of class 0 (have to be sorted)
    `scoresClass1` - the scores of class 1 (have to be sorted)
    `sensitivity` - the fixed sensitivity which is used to measure the FPR
  Returns:
    the pair containing the threshold and the FPR
  Throws:
    `IllegalArgumentException` - if the sensitivity is not in (0,1)

### getPPVForSensitivity

    protected static ScoreBasedPerformanceMeasureDefinitions.ThresholdMeasurePair getPPVForSensitivity(double[] scoresClass0,
                                                                                                       double[] scoresClass1,
                                                                                                       double sensitivity)
                                                                                                throws IllegalArgumentException

  This method computes the positive predictive value (PPV) for a given sensitivity.

  Parameters:
    `scoresClass0` - the scores of class 0 (have to be sorted)
    `scoresClass1` - the scores of class 1 (have to be sorted)
    `sensitivity` - the fixed sensitivity which is used to measure the PPV
  Returns:
    the pair containing the threshold and the PPV
  Throws:
    `IllegalArgumentException` - if the sensitivity is not in (0,1)

### getMaxOfCC

    protected static ScoreBasedPerformanceMeasureDefinitions.ThresholdMeasurePair getMaxOfCC(double[] scoresClass0,
                                                                                             double[] scoresClass1)
                                                                                      throws Exception

  This method computes the maximal correlation coefficient (CC_max).

  Parameters:
    `scoresClass0` - the scores of class 0 (have to be sorted)
    `scoresClass1` - the scores of class 1 (have to be sorted)
  Returns:
    the pair containing the threshold and the CC_max
  Throws:
    `Exception` - if the CC_max can not be computed

### getSensitivityForSpecificity

    protected static ScoreBasedPerformanceMeasureDefinitions.ThresholdMeasurePair getSensitivityForSpecificity(double[] scoresClass0,
                                                                                                               double[] scoresClass1,
                                                                                                               double specificity)
                                                                                                        throws IllegalArgumentException

  This method computes the sensitivity for a given specificity.

  Parameters:
    `scoresClass0` - the scores of class 0 (have to be sorted)
    `scoresClass1` - the scores of class 1 (have to be sorted)
    `specificity` - the specificity that is used to measure the sensitivity
  Returns:
    the pair containing the threshold and the sensitivity
  Throws:
    `IllegalArgumentException` - if the specificity is not in (0,1)

### getClassificationRateFor2Classes

    protected static double getClassificationRateFor2Classes(double[] scoresClass0,
                                                             double[] scoresClass1)

  This method computes the classification rate.

  Parameters:
    `scoresClass0` - the scores of class 0 (have to be sorted)
    `scoresClass1` - the scores of class 1 (have to be sorted)
  Returns:
    the classification rate

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD