public class TrainTestEvalTask extends AbstractTask<Table>
Constructor and Description |
---|
TrainTestEvalTask() |
TrainTestEvalTask(String name) |
Modifier and Type | Method and Description |
---|---|
TrainTestEvalTask |
addAlgorithm(AlgorithmInstance algorithm) |
TrainTestEvalTask |
addAlgorithm(Map<String,Object> attrs,
String file) |
TrainTestEvalTask |
addDataset(TTDataSet source) |
TrainTestEvalTask |
addExternalAlgorithm(ExternalAlgorithm algorithm) |
<T> TrainTestEvalTask |
addMetric(Class<? extends Metric<T>> metricClass)
Add a metric by class.
|
TrainTestEvalTask |
addMetric(List<String> columns,
Function<Recommender,List<Object>> metric)
Add a metric that takes some metric of an algorithmInfo.
|
TrainTestEvalTask |
addMetric(Metric<?> metric)
Add a metric.
|
TrainTestEvalTask |
addMetric(MetricFactory<?> factory)
Add a metric by factory.
|
TrainTestEvalTask |
addMultiMetric(File file,
List<String> columns,
Function<Recommender,List<List<Object>>> metric)
Add a metric that may write multiple columns per algorithmInfo.
|
TrainTestEvalTask |
addWritePredictionChannel(Symbol channelSym)
Add a channel to be recorded with predict output.
|
TrainTestEvalTask |
addWritePredictionChannel(Symbol channelSym,
String label)
Deprecated.
Use the
predictions metric. |
boolean |
getCacheAllComponents() |
File |
getComponentCacheDirectory() |
org.grouplens.lenskit.eval.traintest.ExperimentSuite |
getExperiments() |
org.grouplens.lenskit.eval.traintest.MeasurementSuite |
getMeasurements() |
org.grouplens.lenskit.eval.traintest.ExperimentOutputLayout |
getOutputLayout() |
org.grouplens.lenskit.eval.traintest.ExperimentOutputs |
getOutputs() |
File |
getTaskGraphFile() |
File |
getTaskStatusFile() |
Table |
perform()
Run the evaluation on the train test data source files
|
TrainTestEvalTask |
setCacheAllComponents(boolean flag)
Control whether all components are cached.
|
TrainTestEvalTask |
setComponentCacheDirectory(File file)
Set the component cache directory.
|
TrainTestEvalTask |
setComponentCacheDirectory(String fn)
Set the component cache directory by name.
|
TrainTestEvalTask |
setIsolate(boolean iso)
Deprecated.
Isolate data sets instead.
|
TrainTestEvalTask |
setOutput(File file) |
TrainTestEvalTask |
setOutput(String fn) |
TrainTestEvalTask |
setPredictOutput(File file)
Deprecated.
|
TrainTestEvalTask |
setPredictOutput(String fn)
Deprecated.
|
TrainTestEvalTask |
setRecommendOutput(File file)
Deprecated.
|
TrainTestEvalTask |
setRecommendOutput(String fn)
Deprecated.
|
TrainTestEvalTask |
setSeparateAlgorithms(boolean sep)
Control whether the evaluator separates or combines algorithms.
|
TrainTestEvalTask |
setTaskGraphFile(File f)
Set an output file for a description of the task graph.
|
TrainTestEvalTask |
setTaskGraphFile(String f)
Set an output file for a description of the task graph.
|
TrainTestEvalTask |
setTaskStatusFile(File f)
Set an output file for task status updates.
|
TrainTestEvalTask |
setTaskStatusFile(String f)
Set an output file for task status updates.
|
TrainTestEvalTask |
setUserOutput(File file) |
TrainTestEvalTask |
setUserOutput(String fn) |
execute, getName, getProject, setName, setProject
addListener, cancel, get, get, interruptTask, isCancelled, isDone, set, setException, wasInterrupted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener
public TrainTestEvalTask()
public TrainTestEvalTask(String name)
public TrainTestEvalTask addDataset(TTDataSet source)
public TrainTestEvalTask addAlgorithm(AlgorithmInstance algorithm)
public TrainTestEvalTask addAlgorithm(Map<String,Object> attrs, String file) throws IOException, RecommenderConfigurationException
public TrainTestEvalTask addExternalAlgorithm(ExternalAlgorithm algorithm)
public TrainTestEvalTask addMetric(Metric<?> metric)
metric
- The metric to add.public TrainTestEvalTask addMetric(MetricFactory<?> factory)
factory
- The metric factory to add.public <T> TrainTestEvalTask addMetric(Class<? extends Metric<T>> metricClass)
T
- The metric's return type.metricClass
- The metric class.public TrainTestEvalTask addMultiMetric(File file, List<String> columns, Function<Recommender,List<List<Object>>> metric)
file
- The output file.columns
- The column headers.metric
- The metric function. It should return a list of table rows, each of which has
entries corresponding to each column.public TrainTestEvalTask addMetric(List<String> columns, Function<Recommender,List<Object>> metric)
columns
- The column headers.metric
- The metric function. It should return a list of table rows, each of which has
entries corresponding to each column.public TrainTestEvalTask addWritePredictionChannel(@Nonnull Symbol channelSym)
channelSym
- The channel to output.addWritePredictionChannel(org.grouplens.lenskit.symbols.Symbol)
@Deprecated public TrainTestEvalTask addWritePredictionChannel(@Nonnull Symbol channelSym, @Nullable String label)
predictions
metric.channelSym
- The channel to record, if present in the prediction output vector.label
- The column label. If null
, the channel symbol's name is used.setPredictOutput(File)
public TrainTestEvalTask setOutput(File file)
public TrainTestEvalTask setOutput(String fn)
public TrainTestEvalTask setUserOutput(File file)
public TrainTestEvalTask setUserOutput(String fn)
@Deprecated public TrainTestEvalTask setPredictOutput(File file)
@Deprecated public TrainTestEvalTask setPredictOutput(String fn)
@Deprecated public TrainTestEvalTask setRecommendOutput(File file)
@Deprecated public TrainTestEvalTask setRecommendOutput(String fn)
public TrainTestEvalTask setComponentCacheDirectory(File file)
file
- The cache directory.setSeparateAlgorithms(boolean)
public TrainTestEvalTask setComponentCacheDirectory(String fn)
setComponentCacheDirectory(java.io.File)
public File getComponentCacheDirectory()
public TrainTestEvalTask setCacheAllComponents(boolean flag)
flag
- true
to cache all components.public boolean getCacheAllComponents()
@Deprecated public TrainTestEvalTask setIsolate(boolean iso)
true
,
then each data set will be run in turn, with no inter-data-set parallelism. This can
reduce memory usage for some large runs, keeping the data from only a single data set in
memory at a time. Otherwise (the default), individual algorithmInfo/data-set runs may be freely
intermingled.iso
- Whether to isolate data sets.public TrainTestEvalTask setSeparateAlgorithms(boolean sep)
true
, each
algorithm instance is built without reusing components from other algorithm instances.
By default, LensKit will try to reuse common components between algorithm configurations
(one downside of this is that it makes build timings meaningless).sep
- If true
, separate algorithms.public TrainTestEvalTask setTaskGraphFile(File f)
f
- The output file.public TrainTestEvalTask setTaskGraphFile(String f)
f
- The output file namepublic File getTaskGraphFile()
public TrainTestEvalTask setTaskStatusFile(File f)
f
- The output file.public TrainTestEvalTask setTaskStatusFile(String f)
f
- The output file namepublic File getTaskStatusFile()
public Table perform() throws TaskExecutionException, InterruptedException
perform
in class AbstractTask<Table>
TaskExecutionException
- Failure of the evaluationInterruptedException
public org.grouplens.lenskit.eval.traintest.ExperimentSuite getExperiments()
public org.grouplens.lenskit.eval.traintest.MeasurementSuite getMeasurements()
public org.grouplens.lenskit.eval.traintest.ExperimentOutputLayout getOutputLayout()
public org.grouplens.lenskit.eval.traintest.ExperimentOutputs getOutputs()