Package weka.classifiers.evaluation
Class AbstractEvaluationMetric
java.lang.Object
weka.classifiers.evaluation.AbstractEvaluationMetric
- All Implemented Interfaces:
Serializable
Abstract base class for pluggable classification/regression evaluation
metrics.
- Version:
- $Revision: 15006 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Exception for subclasses to throw if asked for a statistic that is not part of their implementation -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
Return true if this evaluation metric can be computed when the class is nominalabstract boolean
Return true if this evaluation metric can be computed when the class is numericabstract String
Get a short description of this metric (algorithm, forumulas etc.).abstract String
Get the name of this metricstatic ArrayList<AbstractEvaluationMetric>
Gets a list of freshly instantiated concrete implementations of available plugin metrics or null if there are no plugin metrics availableabstract double
getStatistic
(String statName) Get the value of the named statisticGet 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.
-
Constructor Details
-
AbstractEvaluationMetric
public AbstractEvaluationMetric()
-
-
Method Details
-
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
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
Get the name of this metric- Returns:
- the name of this metric
-
getMetricDescription
Get a short description of this metric (algorithm, forumulas etc.).- Returns:
- a short description of this metric
-
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
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
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)
-