public class MAEPredictMetric extends AbstractMetric<MAEPredictMetric.Context,MAEPredictMetric.AggregateResult,MAEPredictMetric.UserResult>
RMSEPredictMetric
) to MAE.
This evaluator computes two variants of MAE. The first is by-rating, where the absolute error is averaged over all predictions. The second is by-user, where the MAE is computed per-user and then averaged over all users.
Modifier and Type | Class and Description |
---|---|
static class |
MAEPredictMetric.AggregateResult |
class |
MAEPredictMetric.Context |
static class |
MAEPredictMetric.UserResult |
Constructor and Description |
---|
MAEPredictMetric() |
Modifier and Type | Method and Description |
---|---|
MAEPredictMetric.Context |
createContext(Attributed algo,
TTDataSet ds,
Recommender rec)
Create the context for an experimental condition (algorithm/data set pair).
|
MAEPredictMetric.UserResult |
doMeasureUser(TestUser user,
MAEPredictMetric.Context context)
Measure a user with typed results.
|
protected MAEPredictMetric.AggregateResult |
getTypedResults(MAEPredictMetric.Context context)
Get the typed results from an accumulator.
|
close, getColumnLabels, getPrefix, getResults, getSuffix, getUserColumnLabels, measureUser
public MAEPredictMetric.Context createContext(Attributed algo, TTDataSet ds, Recommender rec)
Metric
algo
- The algorithm.ds
- The data set.rec
- The LensKit recommender, if applicable. This can be null for an external
algorithm that does not provide a LensKit recommender.Metric.measureUser(TestUser, Object)
. If
the metric does not accumulate any results, this method can return null
.public MAEPredictMetric.UserResult doMeasureUser(TestUser user, MAEPredictMetric.Context context)
AbstractMetric
doMeasureUser
in class AbstractMetric<MAEPredictMetric.Context,MAEPredictMetric.AggregateResult,MAEPredictMetric.UserResult>
user
- The user to measure.context
- The context.null
to emit NAs for the user.protected MAEPredictMetric.AggregateResult getTypedResults(MAEPredictMetric.Context context)
AbstractMetric
getTypedResults
in class AbstractMetric<MAEPredictMetric.Context,MAEPredictMetric.AggregateResult,MAEPredictMetric.UserResult>
context
- The context.null
to emit NAs.