Package 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.SerializableAbstract 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 classAbstractEvaluationMetric.UnknownStatisticExceptionException for subclasses to throw if asked for a statistic that is not part of their implementation
-
Constructor Summary
Constructors Constructor Description AbstractEvaluationMetric()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanappliesToNominalClass()Return true if this evaluation metric can be computed when the class is nominalabstract booleanappliesToNumericClass()Return true if this evaluation metric can be computed when the class is numericabstract java.lang.StringgetMetricDescription()Get a short description of this metric (algorithm, forumulas etc.).abstract java.lang.StringgetMetricName()Get the name of this metricstatic 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 availableabstract doublegetStatistic(java.lang.String statName)Get the value of the named statisticabstract java.util.List<java.lang.String>getStatisticNames()Get a list of the names of the statistics that this metrics computes.voidsetBaseEvaluation(Evaluation eval)Set the base evaluation object to use.booleanstatisticIsMaximisable(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.
-
-
-
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)
-
-