public abstract class PredictMetric<X> extends Metric<X>
Base class for metrics that measure predictions for users.
Modifier | Constructor and Description |
---|---|
protected |
PredictMetric(java.lang.Class<? extends TypedMetricResult> resType,
java.lang.Class<? extends TypedMetricResult> aggType)
Construct a new result metric.
|
protected |
PredictMetric(java.util.List<java.lang.String> labels,
java.util.List<java.lang.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(java.util.List<java.lang.String> labels, java.util.List<java.lang.String> aggLabels)
Construct a new result metric.
labels
- Column labels.aggLabels
- Aggregate column labels.protected PredictMetric(java.lang.Class<? extends TypedMetricResult> resType, java.lang.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.
Thread Safety: This method may be called concurrently by multiple threads with the same recommender and context.
user
- The user’s test data.predictions
- The predictions.