public class MAEPredictMetric extends PredictMetric<MAEPredictMetric.Context>
Evaluate a recommender’s prediction accuracy with MAE (Mean Absolute Error).
| Modifier and Type | Class and Description |
|---|---|
class |
MAEPredictMetric.Context |
| Constructor and Description |
|---|
MAEPredictMetric() |
| Modifier and Type | Method and Description |
|---|---|
MAEPredictMetric.Context |
createContext(AlgorithmInstance algorithm,
DataSet dataSet,
Recommender recommender)
Create the context for an experimental condition (algorithm/data set pair).
|
MetricResult |
getAggregateMeasurements(MAEPredictMetric.Context context)
Get the aggregate results from an accumulator.
|
MetricResult |
measureUser(TestUser user,
ResultMap predictions,
MAEPredictMetric.Context context)
Measure a single result.
|
getAggregateColumnLabels, getColumnLabels, getRequiredRoots@Nullable public MAEPredictMetric.Context createContext(AlgorithmInstance algorithm, DataSet dataSet, Recommender recommender)
MetricCreate the context for an experimental condition (algorithm/data set pair). The default implementation returns null.
createContext in class Metric<MAEPredictMetric.Context>algorithm - The algorithm.dataSet - The data set.recommender - The LensKit recommender, if applicable. This can be null for an external algorithm that does not provide a LensKit recommender.null.@Nonnull public MetricResult measureUser(TestUser user, ResultMap predictions, MAEPredictMetric.Context context)
PredictMetricMeasure a single result. The result may come from either prediction or recommendation.
measureUser in class PredictMetric<MAEPredictMetric.Context>user - The user’s test data.predictions - The predictions.@Nonnull public MetricResult getAggregateMeasurements(MAEPredictMetric.Context context)
MetricGet the aggregate results from an accumulator. The default implementation returns MetricResult.empty().
getAggregateMeasurements in class Metric<MAEPredictMetric.Context>context - The context for an experimental condition.