Class MetricTarget<T extends Output<T>>
java.lang.Object
org.tribuo.evaluation.metrics.MetricTarget<T>
- Type Parameters:
T- TheOutputtype.
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
ConstructorsConstructorDescriptionBuilds a metric target for an average.MetricTarget(T target) Builds a metric target for an output. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns 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.inthashCode()static <U extends Output<U>>
MetricTarget<U> Get the singletonMetricTargetwhich contains theEvaluationMetric.Average.MACRO.static <U extends Output<U>>
MetricTarget<U> Get the singletonMetricTargetwhich 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
-
macroAverageTarget
Get the singletonMetricTargetwhich contains theEvaluationMetric.Average.MACRO.- Type Parameters:
U- The output type of theMetricTarget- Returns:
- The
MetricTargetthat provides a macro average.
-
microAverageTarget
Get the singletonMetricTargetwhich contains theEvaluationMetric.Average.MICRO.- Type Parameters:
U- The output type of theMetricTarget- Returns:
- The
MetricTargetthat provides a micro average.
-