Package org.tribuo.evaluation.metrics
Class MetricTarget<T extends Output<T>>
java.lang.Object
org.tribuo.evaluation.metrics.MetricTarget<T>
- Type Parameters:
T
- TheOutput
type.
Used by a given
EvaluationMetric
to determine whether it should compute its value for a specific Output
value
or whether it should average them.-
Constructor Summary
ConstructorDescriptionBuilds a metric target for an average.MetricTarget
(T target) Builds a metric target for an output. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the average this metric computes, orOptional.empty()
if it targets an output.Returns the Output this metric targets, orOptional.empty()
if it's an average.int
hashCode()
static <U extends Output<U>>
MetricTarget<U>Get the singletonMetricTarget
which contains theEvaluationMetric.Average.MACRO
.static <U extends Output<U>>
MetricTarget<U>Get the singletonMetricTarget
which contains theEvaluationMetric.Average.MICRO
.toString()
-
Constructor Details
-
MetricTarget
Builds a metric target for an output.- Parameters:
target
- The output to target.
-
MetricTarget
Builds a metric target for an average.- Parameters:
avg
- The average to compute.
-
-
Method Details
-
getOutputTarget
Returns the Output this metric targets, orOptional.empty()
if it's an average.- Returns:
- The output this metric targets, or
Optional.empty()
.
-
getAverageTarget
Returns the average this metric computes, orOptional.empty()
if it targets an output.- Returns:
- The average this metric computes, or
Optional.empty()
.
-
toString
-
equals
-
hashCode
public int hashCode() -
macroAverageTarget
Get the singletonMetricTarget
which contains theEvaluationMetric.Average.MACRO
.- Type Parameters:
U
- The output type of theMetricTarget
- Returns:
- The
MetricTarget
that provides a macro average.
-
microAverageTarget
Get the singletonMetricTarget
which contains theEvaluationMetric.Average.MICRO
.- Type Parameters:
U
- The output type of theMetricTarget
- Returns:
- The
MetricTarget
that provides a micro average.
-