Package org.tribuo.evaluation
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
Evaluation
s
covering all the Prediction
s it has seen or created.-
Constructor Summary
ConstructorDescriptionOnlineEvaluator
(Evaluator<T, E> evaluator, Model<T> model, DataProvenance provenance) Constructs anOnlineEvaluator
which accumulates predictions. -
Method Summary
Modifier and TypeMethodDescriptionevaluate()
Creates anEvaluation
containing all the current predictions.void
observe
(List<Prediction<T>> newPredictions) Records all the supplied predictions.void
observe
(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 anOnlineEvaluator
which accumulates predictions.- Parameters:
evaluator
- The evaluator to use to makeEvaluation
s.model
- The model to use.provenance
- The provenance of the evaluation data.
-
-
Method Details
-
evaluate
Creates anEvaluation
containing all the current predictions.- Returns:
- An
Evaluation
of 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.
-