LensKit recommender toolkit - OLD. Use Google Group: https://groups.google.com/forum/#!forum/lenskit-recsys
mdekstrand on master
Update README.md (compare)
dependabot[bot] on maven
Bump junit from 4.11 to 4.13.1 … (compare)
private static LenskitConfiguration getAlgorithmConfig() {
LenskitConfiguration cfg = new LenskitConfiguration();
// lenskit.org/documentation/algorithms/user-user/
cfg.bind(ItemScorer.class).to(UserUserItemScorer.class);
cfg.bind(BaselineScorer.class, ItemScorer.class).to(UserMeanItemScorer.class);
cfg.bind(UserMeanBaseline.class, ItemScorer.class).to(ItemMeanRatingItemScorer.class);
cfg.within(UserVectorNormalizer.class).bind(VectorNormalizer.class).to(MeanCenteringVectorNormalizer.class);
cfg.set(NeighborhoodSize.class).to(30);
return cfg;
}
private static EventDAO getEventDAO(String dataPath) {
File file = new File(dataPath);
EventFormat fmt = DelimitedColumnEventFormat
.create(LikeBuilder.class)
.setFields("user", "item", "timestamp")
.setDelimiter(",");
return TextEventDAO.create(file, fmt, CompressionMode.AUTO);
}
// user passed in
Long uid = Long.valueOf(user.getId());
LenskitConfiguration cfg = getAlgorithmConfig();
EventDAO dao = getEventDAO("dataset.csv");
cfg.addComponent(dao);
LenskitRecommenderEngine engine = LenskitRecommenderEngine.build(cfg);
ItemRecommender recommender = engine.createRecommender(cfg).getItemRecommender();
ResultList items = recommender.recommendWithDetails(uid, 10, null, null); // 0 items
Hello Lenskit Team,
We are working on a recommender project and would like to use the Lenskit SVD algorithm by Simon Funk.
We configured our model as shown on http://lenskit.org/documentation/algorithms/svd/
Our question: It is enough to just hand over the sparse User-Item-Rating Matrix, right?
How can we do that (A code snippet of such a call would be nice)
Thanks a lot!
Best,
CarKla
Hi @mdekstrand, I'm looking to use LensKit in the context of an actual application performing recommending, and I had a few questions
I've set up the configuration very similarly to the tutorial for now, like so:
LenskitConfiguration config = new LenskitConfiguration();
config.bind(ItemScorer.class).to(ItemItemScorer.class);
config.bind(BaselineScorer.class, ItemScorer.class).to(UserMeanItemScorer.class);
config.bind(UserMeanBaseline.class, ItemScorer.class).to(ItemMeanRatingItemScorer.class);
config.bind(UserVectorNormalizer.class).to(BaselineSubtractingUserVectorNormalizer.class);
config.bind(EventDAO.class).to(this.createDAO());
PreferenceDomainBuilder pdbuilder = new PreferenceDomainBuilder(-10, 10).setPrecision(0.01);
PreferenceDomain pd = pdbuilder.build();
config.bind(PreferenceDomain.class).to(pd);
LenskitRecommender rec = LenskitRecommender.build(config);
RatingPredictor pred = rec.getRatingPredictor();
double predicted = pred.predict(userId, jokeId);
Will the predicted value be de-normalized? And if I ask for an existing value, should it match exactly or only closely? Lastly, is there a way to add a single rating to a LenskitRecommender without rebuilding it?