public abstract class PredictMetric<X> extends Metric<X>
Base class for metrics that measure predictions for users.
Modifier | Constructor and Description |
---|---|
protected |
PredictMetric(Class<? extends TypedMetricResult> resType,
Class<? extends TypedMetricResult> aggType)
Construct a new result metric.
|
protected |
PredictMetric(List<String> labels,
List<String> aggLabels)
Construct a new result metric.
|
Modifier and Type | Method and Description |
---|---|
abstract MetricResult |
measureUser(TestUser user,
ResultMap predictions,
X context)
Measure a single result.
|
createContext, getAggregateColumnLabels, getAggregateMeasurements, getColumnLabels, getRequiredRoots
protected PredictMetric(List<String> labels, List<String> aggLabels)
Construct a new result metric.
labels
- Column labels.aggLabels
- Aggregate column labels.protected PredictMetric(Class<? extends TypedMetricResult> resType, Class<? extends TypedMetricResult> aggType)
Construct a new result metric.
resType
- The result type for measuring results, or null
for no measurement.aggType
- The result type for aggregate measurements, or null
for no measurement.@Nonnull public abstract MetricResult measureUser(TestUser user, ResultMap predictions, X context)
Measure a single result. The result may come from either prediction or recommendation.
user
- The user’s test data.predictions
- The predictions.