T
- The Output
type.public class MetricTarget<T extends Output<T>> extends Object
EvaluationMetric
to determine whether it should compute its value for a specific Output
value
or whether it should average them.Constructor and Description |
---|
MetricTarget(EvaluationMetric.Average avg)
Builds a metric target for an average.
|
MetricTarget(T target)
Builds a metric target for an output.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Optional<EvaluationMetric.Average> |
getAverageTarget()
Returns the average this metric computes, or
Optional.empty() if it targets an output. |
Optional<T> |
getOutputTarget()
Returns the Output this metric targets, or
Optional.empty() if it's an average. |
int |
hashCode() |
static <U extends Output<U>> |
macroAverageTarget()
Get the singleton
MetricTarget which contains the EvaluationMetric.Average.MACRO . |
static <U extends Output<U>> |
microAverageTarget()
Get the singleton
MetricTarget which contains the EvaluationMetric.Average.MICRO . |
String |
toString() |
public MetricTarget(T target)
target
- The output to target.public MetricTarget(EvaluationMetric.Average avg)
avg
- The average to compute.public Optional<T> getOutputTarget()
Optional.empty()
if it's an average.Optional.empty()
.public Optional<EvaluationMetric.Average> getAverageTarget()
Optional.empty()
if it targets an output.Optional.empty()
.public static <U extends Output<U>> MetricTarget<U> macroAverageTarget()
MetricTarget
which contains the EvaluationMetric.Average.MACRO
.U
- The output type of the MetricTarget
MetricTarget
that provides a macro average.public static <U extends Output<U>> MetricTarget<U> microAverageTarget()
MetricTarget
which contains the EvaluationMetric.Average.MICRO
.U
- The output type of the MetricTarget
MetricTarget
that provides a micro average.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.