Jean-Francois Leveque

Correction configuration FunkSVD

...@@ -5,9 +5,14 @@ import org.grouplens.lenskit.ItemRecommender; ...@@ -5,9 +5,14 @@ import org.grouplens.lenskit.ItemRecommender;
5 import org.grouplens.lenskit.ItemScorer; 5 import org.grouplens.lenskit.ItemScorer;
6 import org.grouplens.lenskit.RecommenderBuildException; 6 import org.grouplens.lenskit.RecommenderBuildException;
7 import org.grouplens.lenskit.baseline.BaselineScorer; 7 import org.grouplens.lenskit.baseline.BaselineScorer;
8 +import org.grouplens.lenskit.baseline.ItemMeanRatingItemScorer;
9 +import org.grouplens.lenskit.baseline.UserMeanBaseline;
10 +import org.grouplens.lenskit.baseline.UserMeanItemScorer;
8 import org.grouplens.lenskit.core.LenskitConfiguration; 11 import org.grouplens.lenskit.core.LenskitConfiguration;
9 import org.grouplens.lenskit.core.LenskitRecommender; 12 import org.grouplens.lenskit.core.LenskitRecommender;
10 import org.grouplens.lenskit.data.dao.EventDAO; 13 import org.grouplens.lenskit.data.dao.EventDAO;
14 +import org.grouplens.lenskit.data.dao.PrefetchingUserEventDAO;
15 +import org.grouplens.lenskit.data.dao.UserEventDAO;
11 import org.grouplens.lenskit.data.history.RatingVectorUserHistorySummarizer; 16 import org.grouplens.lenskit.data.history.RatingVectorUserHistorySummarizer;
12 import org.grouplens.lenskit.data.history.UserHistorySummarizer; 17 import org.grouplens.lenskit.data.history.UserHistorySummarizer;
13 import org.grouplens.lenskit.data.pref.PreferenceDomain; 18 import org.grouplens.lenskit.data.pref.PreferenceDomain;
...@@ -38,7 +43,8 @@ public class FunkSVDRecommender implements Recommender { ...@@ -38,7 +43,8 @@ public class FunkSVDRecommender implements Recommender {
38 43
39 config.bind(ItemScorer.class).to(FunkSVDItemScorer.class); 44 config.bind(ItemScorer.class).to(FunkSVDItemScorer.class);
40 config.bind(GlobalItemScorer.class).to(ItemItemGlobalScorer.class); 45 config.bind(GlobalItemScorer.class).to(ItemItemGlobalScorer.class);
41 - config.bind(BaselineScorer.class, ItemScorer.class).to(FunkSVDItemScorer.class); 46 + config.bind(BaselineScorer.class, ItemScorer.class).to(UserMeanItemScorer.class);
47 + config.bind(UserMeanBaseline.class, ItemScorer.class).to(ItemMeanRatingItemScorer.class);
42 config.bind(PreferenceDomain.class).to(new PreferenceDomain(1.0, 5.0, 1.0)); 48 config.bind(PreferenceDomain.class).to(new PreferenceDomain(1.0, 5.0, 1.0));
43 config.bind(UserHistorySummarizer.class).to(RatingVectorUserHistorySummarizer.class); 49 config.bind(UserHistorySummarizer.class).to(RatingVectorUserHistorySummarizer.class);
44 50
...@@ -47,8 +53,11 @@ public class FunkSVDRecommender implements Recommender { ...@@ -47,8 +53,11 @@ public class FunkSVDRecommender implements Recommender {
47 delimitedColumnEventFormat.setHeaderLines(1); 53 delimitedColumnEventFormat.setHeaderLines(1);
48 delimitedColumnEventFormat.setFields(Fields.item(), Fields.user(), Fields.rating()); 54 delimitedColumnEventFormat.setFields(Fields.item(), Fields.user(), Fields.rating());
49 55
50 - TextEventDAO textEventDAO = new TextEventDAO(new File(filePath), delimitedColumnEventFormat); 56 + EventDAO eventDAO = new TextEventDAO(new File(filePath), delimitedColumnEventFormat);
51 - config.bind(EventDAO.class).to(textEventDAO); 57 + config.bind(EventDAO.class).to(eventDAO);
58 +
59 + UserEventDAO userEventDAO = new PrefetchingUserEventDAO(eventDAO);
60 + config.bind(UserEventDAO.class).to(userEventDAO);
52 61
53 LenskitRecommender rec; 62 LenskitRecommender rec;
54 63
......