Package org.tribuo.evaluation
Interface EvaluationRenderer<T extends Output<T>,E extends Evaluation<T>>
- Type Parameters:
T
- type of outputE
- type of evaluation
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface EvaluationRenderer<T extends Output<T>,E extends Evaluation<T>>
Renders an
Evaluation
into a String.
For example, an implementation might produce
-
Method Summary
-
Method Details
-
apply
Convert the evaluation to a string. For example:EvaluationRenderer<Label, LabelEvaluation> renderer = (LabelEvaluation eval) -> { StringBuilder sb = new StringBuilder(); sb.append(String.format("macro F1: %.2f", eval.macroAveragedF1())); sb.append(String.format("micro F1: %.2f", eval.microAveragedF1())); return sb.toString(); } LabelEvaluation evaluation = ... System.out.println(renderer.apply(evaluation));
- Parameters:
evaluation
- The evaluation to render.- Returns:
- The renderer's representation of the evaluation as a String.
-