public class OutputPredictMetric extends AbstractMetric<OutputPredictMetric.Context,java.lang.Void,java.lang.Void>
Modifier and Type | Class and Description |
---|---|
static class |
OutputPredictMetric.Context |
static class |
OutputPredictMetric.Factory |
Constructor and Description |
---|
OutputPredictMetric(org.grouplens.lenskit.eval.traintest.ExperimentOutputLayout layout,
java.io.File file,
java.util.List<org.apache.commons.lang3.tuple.Pair<Symbol,java.lang.String>> chans) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the metric.
|
OutputPredictMetric.Context |
createContext(Attributed algo,
TTDataSet ds,
Recommender rec)
Create the context for an experimental condition (algorithm/data set pair).
|
java.lang.Void |
doMeasureUser(TestUser user,
OutputPredictMetric.Context context)
Measure a user with typed results.
|
protected java.lang.Void |
getTypedResults(OutputPredictMetric.Context context)
Get the typed results from an accumulator.
|
getColumnLabels, getPrefix, getResults, getSuffix, getUserColumnLabels, measureUser
public OutputPredictMetric(org.grouplens.lenskit.eval.traintest.ExperimentOutputLayout layout, java.io.File file, java.util.List<org.apache.commons.lang3.tuple.Pair<Symbol,java.lang.String>> chans) throws java.io.IOException
java.io.IOException
public OutputPredictMetric.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 java.lang.Void doMeasureUser(TestUser user, OutputPredictMetric.Context context)
AbstractMetric
doMeasureUser
in class AbstractMetric<OutputPredictMetric.Context,java.lang.Void,java.lang.Void>
user
- The user to measure.context
- The context.null
to emit NAs for the user.protected java.lang.Void getTypedResults(OutputPredictMetric.Context context)
AbstractMetric
getTypedResults
in class AbstractMetric<OutputPredictMetric.Context,java.lang.Void,java.lang.Void>
context
- The context.null
to emit NAs.public void close() throws java.io.IOException
AbstractMetric
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class AbstractMetric<OutputPredictMetric.Context,java.lang.Void,java.lang.Void>
java.io.IOException
- if there is an error closing the metric.