Package org.tribuo.evaluation.metrics
Class MetricContext<T extends Output<T>>
java.lang.Object
org.tribuo.evaluation.metrics.MetricContext<T>
- Direct Known Subclasses:
LabelMetric.Context
The context for a metric or set of metrics. At minimum the model used to generate
the predictions, and the predictions themselves.
-
Constructor Summary
ModifierConstructorDescriptionprotected
MetricContext
(Model<T> model, List<Prediction<T>> predictions) Constructs a metric context.protected
MetricContext
(SequenceModel<T> model, List<Prediction<T>> predictions) Constructs a metric context for a sequence model. -
Method Summary
Modifier and TypeMethodDescriptiongetModel()
Gets the Model used by this context.List<Prediction<T>>
Gets the predictions used by this context.Gets the SequenceModel used by this context.
-
Constructor Details
-
MetricContext
Constructs a metric context.- Parameters:
model
- The model.predictions
- The model's predictions.
-
MetricContext
Constructs a metric context for a sequence model.- Parameters:
model
- The model.predictions
- The model's predictions.
-
-
Method Details
-
getModel
Gets the Model used by this context.- Returns:
- The model, or null if this MetricContext operates on a SequenceModel.
-
getSequenceModel
Gets the SequenceModel used by this context.- Returns:
- The model, or null if this MetricContext operates on a Model.
-
getPredictions
Gets the predictions used by this context.- Returns:
- The predictions.
-