Package weka.classifiers.evaluation

# Class AbstractEvaluationMetric

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

All Implemented Interfaces:
  `Serializable`

public abstract class AbstractEvaluationMetric extends Object implements Serializable
Abstract base class for pluggable classification/regression evaluation metrics.

Version:
  $Revision: 15007 $
Author:
  Mark Hall (mhall{[at]}pentaho{[dot]}com)
See Also:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  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
  Description
  `AbstractEvaluationMetric()`

- ## Method Summary

  Modifier and Type
  Method
  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 String`
  `getMetricDescription()`
  Get a short description of this metric (algorithm, forumulas etc.).
  `abstract String`
  `getMetricName()`
  Get the name of this metric
  `static 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(String statName)`
  Get the value of the named statistic
  `abstract List<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(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 Details

  - ### AbstractEvaluationMetric

    public AbstractEvaluationMetric()

- ## Method Details

  - ### getPluginMetrics

    public static 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 String getMetricName()
    Get the name of this metric
    Returns:
      the name of this metric

  - ### getMetricDescription

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

  - ### getStatisticNames

    public abstract List<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(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(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)