weka.classifiers.evaluation

## Class EvaluationMetricHelper

- java.lang.Object
- - weka.classifiers.evaluation.EvaluationMetricHelper

-     public class EvaluationMetricHelper
      extends java.lang.Object

  Helper routines for extracting metric values from built-in and plugin evaluation metrics.
  Version:
    $Revision: 10934 $
  Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EvaluationMetricHelper(Evaluation eval)` Construct a new EvaluationMetricHelper

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.List<java.lang.String>` | `getAllMetricNames()` Get a list of all available evaluation metric names
    `static java.util.List<java.lang.String>` | `getBuiltInMetricNames()` Get a list of built-in metric names
    `double` | `getNamedMetric(java.lang.String statName, int... classValIndex)` Gets the value of a named metric.
    `double[]` | `getNamedMetricThresholds(java.lang.String statName)` Gets the thresholds produced by the metric, if the metric implements ThresholdProducingMetric.
    `static java.util.List<java.lang.String>` | `getPluginMetricNames()` Get a list of plugin metric names
    `boolean` | `metricIsMaximisable(java.lang.String statName)` Returns true if the named metric is maximisable
    `void` | `setEvaluation(Evaluation eval)` Sets the Evaluation object to use

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EvaluationMetricHelper

          public EvaluationMetricHelper(Evaluation eval)

      Construct a new EvaluationMetricHelper
      Parameters:
        `eval` - the Evaluation object to use

  - ### Method Detail

    - #### setEvaluation

          public void setEvaluation(Evaluation eval)

      Sets the Evaluation object to use
      Parameters:
        `eval` - the Evaluation object to use

    - #### getBuiltInMetricNames

          public static java.util.List<java.lang.String> getBuiltInMetricNames()

      Get a list of built-in metric names
      Returns:
        a list of built-in metric names

    - #### getPluginMetricNames

          public static java.util.List<java.lang.String> getPluginMetricNames()

      Get a list of plugin metric names
      Returns:
        a list of plugin metric names

    - #### getAllMetricNames

          public static java.util.List<java.lang.String> getAllMetricNames()

      Get a list of all available evaluation metric names
      Returns:
        a list of all available evaluation metric names

    - #### getNamedMetric

          public double getNamedMetric(java.lang.String statName,
                                       int... classValIndex)
                                throws java.lang.Exception

      Gets the value of a named metric. For information retrieval metrics if a class value index is not supplied then the class weighted variant is returned.
      Parameters:
        `statName` - the name of the metric/statistic to get
        `classValIndex` - the optional class value index
      Returns:
        the value of the metric
      Throws:
        `java.lang.Exception` - if the metric/stat is unknown or a problem occurs

    - #### getNamedMetricThresholds

          public double[] getNamedMetricThresholds(java.lang.String statName)
                                            throws java.lang.Exception

      Gets the thresholds produced by the metric, if the metric implements ThresholdProducingMetric.
      Parameters:
        `statName` - the name of the metric/statistic to get
      Returns:
        the thresholds, null if metric does not produce any
      Throws:
        `java.lang.Exception` - if the metric/stat is unknown or a problem occurs

    - #### metricIsMaximisable

          public boolean metricIsMaximisable(java.lang.String statName)
                                      throws java.lang.Exception

      Returns true if the named metric is maximisable
      Parameters:
        `statName` - the name of the metric/statistic to check
      Returns:
        true if the metric in question is optimum at a maximal value
      Throws:
        `java.lang.Exception` - if a problem occurs