weka.classifiers.evaluation

## Class AbstractEvaluationMetric

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

- All Implemented Interfaces:
    java.io.Serializable

      public abstract class AbstractEvaluationMetric
      extends java.lang.Object
      implements java.io.Serializable

  Abstract base class for pluggable classification/regression evaluation metrics.
  Version:
    $Revision: 10876 $
  Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `AbstractEvaluationMetric.UnknownStatisticException` Exception for subclasses to throw if asked for a statistic that is not part of their implementation

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractEvaluationMetric()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract boolean` | `appliesToNominalClass()` Return true if this evaluation metric can be computed when the class is nominal
    `abstract boolean` | `appliesToNumericClass()` Return true if this evaluation metric can be computed when the class is numeric
    `abstract java.lang.String` | `getMetricDescription()` Get a short description of this metric (algorithm, forumulas etc.).
    `abstract java.lang.String` | `getMetricName()` Get the name of this metric
    `static java.util.ArrayList<AbstractEvaluationMetric>` | `getPluginMetrics()` Gets a list of freshly instantiated concrete implementations of available plugin metrics or null if there are no plugin metrics available
    `abstract double` | `getStatistic(java.lang.String statName)` Get the value of the named statistic
    `abstract java.util.List<java.lang.String>` | `getStatisticNames()` Get a list of the names of the statistics that this metrics computes.
    `void` | `setBaseEvaluation(Evaluation eval)` Set the base evaluation object to use.
    `boolean` | `statisticIsMaximisable(java.lang.String statName)` True if the optimum value of the named metric is a maximum value; false if the optimim value is a minimum value.

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

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

- - ### Constructor Detail

    - #### AbstractEvaluationMetric

          public AbstractEvaluationMetric()

  - ### Method Detail

    - #### getPluginMetrics

          public static java.util.ArrayList<AbstractEvaluationMetric> getPluginMetrics()

      Gets a list of freshly instantiated concrete implementations of available plugin metrics or null if there are no plugin metrics available
      Returns:
        a list of plugin metrics or null if there are no plugin metrics

    - #### setBaseEvaluation

          public void setBaseEvaluation(Evaluation eval)

      Set the base evaluation object to use. IMPORTANT: subclasses should treat this object as read-only.
      Parameters:
        `eval` -

    - #### appliesToNominalClass

          public abstract boolean appliesToNominalClass()

      Return true if this evaluation metric can be computed when the class is nominal
      Returns:
        true if this evaluation metric can be computed when the class is nominal

    - #### appliesToNumericClass

          public abstract boolean appliesToNumericClass()

      Return true if this evaluation metric can be computed when the class is numeric
      Returns:
        true if this evaluation metric can be computed when the class is numeric

    - #### getMetricName

          public abstract java.lang.String getMetricName()

      Get the name of this metric
      Returns:
        the name of this metric

    - #### getMetricDescription

          public abstract java.lang.String getMetricDescription()

      Get a short description of this metric (algorithm, forumulas etc.).
      Returns:
        a short description of this metric

    - #### getStatisticNames

          public abstract java.util.List<java.lang.String> getStatisticNames()

      Get a list of the names of the statistics that this metrics computes. E.g. an information theoretic evaluation measure might compute total number of bits as well as average bits/instance
      Returns:
        the names of the statistics that this metric computes

    - #### getStatistic

          public abstract double getStatistic(java.lang.String statName)

      Get the value of the named statistic
      Parameters:
        `statName` - the name of the statistic to compute the value for
      Returns:
        the computed statistic or Utils.missingValue() if the statistic can't be computed for some reason

    - #### statisticIsMaximisable

          public boolean statisticIsMaximisable(java.lang.String statName)

      True if the optimum value of the named metric is a maximum value; false if the optimim value is a minimum value. Subclasses should override this method to suit their statistic(s)
      Returns:
        true (default implementation)