config.bind(EventDAO.class).to(EventCollectionDAO.create(rs));
config.bind(ItemScorer.class).to(SlopeOneItemScorer.class);
config.bind(PreferenceDomain.class).to(new PreferenceDomainBuilder(1, 5)
.setPrecision(1)
.build());
ItemScorer predictor = LenskitRecommenderEngine.build(config)
.createRecommender()
.getItemScorer();
assertEquals(7 / 3.0, predictor.score(2, 9), EPSILON);
assertEquals(13 / 3.0, predictor.score(3, 6), EPSILON);
assertEquals(2, predictor.score(4, 6), EPSILON);
assertEquals(2, predictor.score(4, 9), EPSILON);
assertEquals(2.5, predictor.score(5, 6), EPSILON);
assertEquals(3, predictor.score(5, 7), EPSILON);
assertEquals(3.5, predictor.score(5, 9), EPSILON);
assertEquals(1.5, predictor.score(6, 6), EPSILON);
assertEquals(2, predictor.score(6, 7), EPSILON);
assertEquals(2.5, predictor.score(6, 9), EPSILON);
}