public abstract class ResultMetric<X> extends Metric<X>
Base class for metrics that measure individual recommendation or prediction results.
Modifier | Constructor and Description |
---|---|
protected |
ResultMetric(java.lang.Class<? extends TypedMetricResult> resType,
java.lang.Class<? extends TypedMetricResult> aggType)
Construct a new result metric.
|
protected |
ResultMetric(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 |
measureResult(long userId,
Result result,
X context)
Measure a single result.
|
createContext, getAggregateColumnLabels, getAggregateMeasurements, getColumnLabels, getRequiredRoots
protected ResultMetric(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 ResultMetric(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 measureResult(long userId, Result result, X context)
Measure a single result. The result may come from either prediction or recommendation.
userId
- The user ID.result
- The result to measure.