RecommenderGraphBuilder rgb = new RecommenderGraphBuilder();
rgb.setClassLoader(classLoader);
for (Pair<LenskitConfiguration,ModelDisposition> cfg: configurations) {
rgb.addConfiguration(cfg.getLeft());
}
RecommenderInstantiator inst;
try {
inst = RecommenderInstantiator.create(rgb.buildGraph());
} catch (ResolutionException e) {
throw new RecommenderBuildException("Cannot resolve recommender graph", e);
}
DAGNode<Component, Dependency> graph = inst.instantiate();
graph = rewriteGraph(graph);
boolean instantiable = GraphtUtils.getPlaceholderNodes(graph).isEmpty();
return new LenskitRecommenderEngine(graph, instantiable);