public class EvaluationMetricHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Integer> |
m_builtin
A lookup for built-in metrics
|
protected Evaluation |
m_eval
The Evaluation object to extract built-in and plugin metrics from
|
protected java.util.Map<java.lang.String,AbstractEvaluationMetric> |
m_pluginMetrics
A lookup for plugin metrics
|
| Constructor and Description |
|---|
EvaluationMetricHelper(Evaluation eval)
Construct a new EvaluationMetricHelper
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
builtInMetricIsMaximisable(int metricIndex)
Returns true if the specified built-in metric is maximisable
|
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
|
protected double |
getBuiltinMetricValue(int metricIndex,
int... classValIndex)
Gets the value of a built-in metric
|
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
|
protected double |
getPluginMetricValue(AbstractEvaluationMetric m,
java.lang.String statName,
int... classValIndex)
Get the value of a plugin metric
|
protected void |
initializeWithPluginMetrics()
Initializes the plugin lookup
|
boolean |
metricIsMaximisable(java.lang.String statName)
Returns true if the named metric is maximisable
|
protected boolean |
pluginMetricIsMaximisable(AbstractEvaluationMetric m,
java.lang.String statName)
Returns true if the named statistic is maximisable
|
void |
setEvaluation(Evaluation eval)
Sets the Evaluation object to use
|
protected Evaluation m_eval
protected java.util.Map<java.lang.String,java.lang.Integer> m_builtin
protected java.util.Map<java.lang.String,AbstractEvaluationMetric> m_pluginMetrics
public EvaluationMetricHelper(Evaluation eval)
eval - the Evaluation object to usepublic void setEvaluation(Evaluation eval)
eval - the Evaluation object to useprotected void initializeWithPluginMetrics()
public static java.util.List<java.lang.String> getBuiltInMetricNames()
public static java.util.List<java.lang.String> getPluginMetricNames()
public static java.util.List<java.lang.String> getAllMetricNames()
protected boolean builtInMetricIsMaximisable(int metricIndex)
throws java.lang.Exception
metricIndex - the index of metricjava.lang.Exception - if the metric is not a known built-in metricprotected double getBuiltinMetricValue(int metricIndex,
int... classValIndex)
throws java.lang.Exception
metricIndex - the index of the metricclassValIndex - the optional class value indexjava.lang.Exception - if the metric is not a known built-in metricprotected double getPluginMetricValue(AbstractEvaluationMetric m, java.lang.String statName, int... classValIndex) throws java.lang.Exception
m - the metric to get the value fromstatName - the name of the statistic to get the value ofclassValIndex - the optional class value indexjava.lang.Exception - if a problem occursprotected boolean pluginMetricIsMaximisable(AbstractEvaluationMetric m, java.lang.String statName)
m - the metric to checkstatName - the name of the statistic to checkpublic double getNamedMetric(java.lang.String statName,
int... classValIndex)
throws java.lang.Exception
statName - the name of the metric/statistic to getclassValIndex - the optional class value indexjava.lang.Exception - if the metric/stat is unknown or a problem occurspublic double[] getNamedMetricThresholds(java.lang.String statName)
throws java.lang.Exception
statName - the name of the metric/statistic to getjava.lang.Exception - if the metric/stat is unknown or a problem occurspublic boolean metricIsMaximisable(java.lang.String statName)
throws java.lang.Exception
statName - the name of the metric/statistic to checkjava.lang.Exception - if a problem occurs