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.
An evaluator which aggregates predictions and produces
Evaluations
covering all the Predictions it has seen or created.-
Constructor Summary
ConstructorsConstructorDescriptionOnlineEvaluator(Evaluator<T, E> evaluator, Model<T> model, DataProvenance provenance) Constructs anOnlineEvaluatorwhich accumulates predictions. -
Method Summary
Modifier and TypeMethodDescriptionevaluate()Creates anEvaluationcontaining all the current predictions.voidobserve(List<Prediction<T>> newPredictions) Records all the supplied predictions.voidobserve(Prediction<T> newPrediction) Records the supplied prediction.List<Prediction<T>> predictAndObserve(Iterable<Example<T>> examples) Feeds the examples to the model, records the predictions and returns them.predictAndObserve(Example<T> example) Feeds the example to the model, records the prediction and returns it.
-
Constructor Details
-
OnlineEvaluator
Constructs anOnlineEvaluatorwhich accumulates predictions.- Parameters:
evaluator- The evaluator to use to makeEvaluations.model- The model to use.provenance- The provenance of the evaluation data.
-
-
Method Details
-
evaluate
Creates anEvaluationcontaining all the current predictions.- Returns:
- An
Evaluationof the appropriate type.
-
predictAndObserve
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
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
Records the supplied prediction.- Parameters:
newPrediction- The prediction to record.
-
observe
Records all the supplied predictions.- Parameters:
newPredictions- The predictions to record.
-