Class OnlineEvaluator<T extends Output<T>,E extends Evaluation<T>>

java.lang.Object
org.tribuo.evaluation.OnlineEvaluator<T,E>
Type Parameters:
T - The output type.
E - The evaluation type.

public final class OnlineEvaluator<T extends Output<T>,E extends Evaluation<T>> extends Object
An evaluator which aggregates predictions and produces Evaluations covering all the Predictions it has seen or created.
  • Constructor Details

    • OnlineEvaluator

      public OnlineEvaluator(Evaluator<T,E> evaluator, Model<T> model, DataProvenance provenance)
      Constructs an OnlineEvaluator which accumulates predictions.
      Parameters:
      evaluator - The evaluator to use to make Evaluations.
      model - The model to use.
      provenance - The provenance of the evaluation data.
  • Method Details

    • evaluate

      public E evaluate()
      Creates an Evaluation containing all the current predictions.
      Returns:
      An Evaluation of the appropriate type.
    • predictAndObserve

      public Prediction<T> predictAndObserve(Example<T> example)
      Feeds the example to the model, records the prediction and returns it.
      Parameters:
      example - The example to predict.
      Returns:
      The model prediction for this example.
    • predictAndObserve

      public List<Prediction<T>> predictAndObserve(Iterable<Example<T>> examples)
      Feeds the examples to the model, records the predictions and returns them.
      Parameters:
      examples - The examples to predict.
      Returns:
      The model predictions for the supplied examples.
    • observe

      public void observe(Prediction<T> newPrediction)
      Records the supplied prediction.
      Parameters:
      newPrediction - The prediction to record.
    • observe

      public void observe(List<Prediction<T>> newPredictions)
      Records all the supplied predictions.
      Parameters:
      newPredictions - The predictions to record.