Constructor and Description |
---|
FunctionModelMetric(List<String> columns,
Function<Recommender,List<Object>> func) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
List<Object> |
createContext(Attributed algorithm,
TTDataSet dataSet,
Recommender recommender)
Create the context for an experimental condition (algorithm/data set pair).
|
List<String> |
getColumnLabels()
Get labels for the aggregate columns output by this evaluator.
|
List<Object> |
getResults(List<Object> context)
Get the aggregate results from an accumulator.
|
List<String> |
getUserColumnLabels()
Get labels for the per-user columns output by this evaluator.
|
List<Object> |
measureUser(TestUser user,
List<Object> context)
Measure a user in the evaluation.
|
public List<String> getColumnLabels()
Metric
getColumnLabels
in interface Metric<List<Object>>
public List<String> getUserColumnLabels()
Metric
getUserColumnLabels
in interface Metric<List<Object>>
Metric.measureUser(TestUser, Object)
public List<Object> createContext(Attributed algorithm, TTDataSet dataSet, Recommender recommender)
Metric
createContext
in interface Metric<List<Object>>
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.Metric.measureUser(TestUser, Object)
. If
the metric does not accumulate any results, this method can return null
.@Nonnull public List<Object> measureUser(TestUser user, List<Object> context)
Metric
measureUser
in interface Metric<List<Object>>
user
- The user to evaluate.context
- The context for the active experimental condition.@Nonnull public List<Object> getResults(List<Object> context)
Metric
getResults
in interface Metric<List<Object>>
context
- The context for an experimental condition.public void close()
close
in interface Closeable
close
in interface AutoCloseable