Class LabelMetric.Context

java.lang.Object
org.tribuo.evaluation.metrics.MetricContext<Label>
org.tribuo.classification.evaluation.LabelMetric.Context
Enclosing class:
LabelMetric

public static final class LabelMetric.Context extends MetricContext<Label>
The context for a LabelMetric is a ConfusionMatrix.
  • Constructor Details

    • Context

      public Context(Model<Label> model, List<Prediction<Label>> predictions)
      Constructs a context and compute the confusion matrix using the specified model and predictions.
      Parameters:
      model - The model.
      predictions - The predictions.
    • Context

      public Context(SequenceModel<Label> model, List<Prediction<Label>> predictions)
      Constructs a context and compute the confusion matrix using the specified model and predictions.
      Parameters:
      model - The model.
      predictions - The predictions.
  • Method Details

    • getCM

      public ConfusionMatrix<Label> getCM()
      Gets the confusion matrix.
      Returns:
      The confusion matrix.