public Table perform() throws TaskExecutionException, InterruptedException {
try {
experiments = createExperimentSuite();
measurements = createMeasurementSuite();
layout = ExperimentOutputLayout.create(experiments, measurements);
TableBuilder resultsBuilder = new TableBuilder(layout.getResultsLayout());
logger.info("Starting evaluation of {} algorithms ({} from LensKit) on {} data sets",
Iterables.size(experiments.getAllAlgorithms()),
experiments.getAlgorithms().size(),
experiments.getDataSets().size());
Closer closer = Closer.create();
try {
outputs = openExperimentOutputs(layout, measurements, resultsBuilder, closer);
DAGNode<JobGraph.Node,JobGraph.Edge> jobGraph;
try {
jobGraph = makeJobGraph(experiments);
} catch (RecommenderConfigurationException ex) {
throw new TaskExecutionException("Recommender configuration error", ex);
}
if (taskGraphFile != null) {
logger.info("writing task graph to {}", taskGraphFile);
JobGraph.writeGraphDescription(jobGraph, taskGraphFile);
}
registerTaskListener(jobGraph);
// tell all metrics to get started
runEvaluations(jobGraph);
} catch (Throwable th) {
throw closer.rethrow(th, TaskExecutionException.class, InterruptedException.class);
} finally {
closer.close();
}
logger.info("evaluation {} completed", getName());
return resultsBuilder.build();
} catch (IOException e) {
throw new TaskExecutionException("I/O error", e);
} finally {
experiments = null;
measurements = null;