public class RMSEPredictMetric extends PredictMetric<RMSEPredictMetric.Context>
Evaluate a recommender’s prediction accuracy with RMSE.
Modifier and Type | Class and Description |
---|---|
class |
RMSEPredictMetric.Context |
Constructor and Description |
---|
RMSEPredictMetric() |
Modifier and Type | Method and Description |
---|---|
RMSEPredictMetric.Context |
createContext(AlgorithmInstance algorithm,
DataSet dataSet,
Recommender recommender)
Create the context for an experimental condition (algorithm/data set pair).
|
MetricResult |
getAggregateMeasurements(RMSEPredictMetric.Context context)
Get the aggregate results from an accumulator.
|
MetricResult |
measureUser(TestUser user,
ResultMap predictions,
RMSEPredictMetric.Context context)
Measure a single result.
|
getAggregateColumnLabels, getColumnLabels, getRequiredRoots
@Nullable public RMSEPredictMetric.Context createContext(AlgorithmInstance algorithm, DataSet dataSet, Recommender recommender)
Metric
Create the context for an experimental condition (algorithm/data set pair). The default implementation returns null
.
createContext
in class Metric<RMSEPredictMetric.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, RMSEPredictMetric.Context context)
PredictMetric
Measure a single result. The result may come from either prediction or recommendation.
measureUser
in class PredictMetric<RMSEPredictMetric.Context>
user
- The user’s test data.predictions
- The predictions.@Nonnull public MetricResult getAggregateMeasurements(RMSEPredictMetric.Context context)
Metric
Get the aggregate results from an accumulator. The default implementation returns MetricResult.empty()
.
getAggregateMeasurements
in class Metric<RMSEPredictMetric.Context>
context
- The context for an experimental condition.