Package org.grouplens.lenskit.core

Examples of org.grouplens.lenskit.core.LenskitConfiguration.bind()


        EventDAO dao = new EventCollectionDAO(rs);

        LenskitConfiguration config = new LenskitConfiguration();
        config.bind(EventDAO.class).to(dao);
        config.bind(ItemItemModel.class).toProvider(NormalizingItemItemModelBuilder.class);
        config.bind(ItemScorer.class).to(ItemItemScorer.class);
        config.bind(GlobalItemScorer.class).to(ItemItemGlobalScorer.class);
        // this is the default
//        factory.setComponent(UserVectorNormalizer.class, VectorNormalizer.class,
//                             IdentityVectorNormalizer.class);
View Full Code Here


        LenskitConfiguration config = new LenskitConfiguration();
        config.bind(EventDAO.class).to(dao);
        config.bind(ItemItemModel.class).toProvider(NormalizingItemItemModelBuilder.class);
        config.bind(ItemScorer.class).to(ItemItemScorer.class);
        config.bind(GlobalItemScorer.class).to(ItemItemGlobalScorer.class);
        // this is the default
//        factory.setComponent(UserVectorNormalizer.class, VectorNormalizer.class,
//                             IdentityVectorNormalizer.class);

        engine = LenskitRecommenderEngine.build(config);
View Full Code Here

        if (output == null) {
            logger.error("no output file specified");
            throw new IllegalStateException("no graph output file specified");
        }
        LenskitConfiguration daoConfig = new LenskitConfiguration();
        daoConfig.bind(EventDAO.class).toProvider(Providers.<EventDAO>of(null, EventDAO.class));
        if (domain != null) {
            daoConfig.bind(PreferenceDomain.class).to(domain);
        }

        RecommenderGraphBuilder rgb = new RecommenderGraphBuilder();
View Full Code Here

            throw new IllegalStateException("no graph output file specified");
        }
        LenskitConfiguration daoConfig = new LenskitConfiguration();
        daoConfig.bind(EventDAO.class).toProvider(Providers.<EventDAO>of(null, EventDAO.class));
        if (domain != null) {
            daoConfig.bind(PreferenceDomain.class).to(domain);
        }

        RecommenderGraphBuilder rgb = new RecommenderGraphBuilder();
        rgb.addConfiguration(daoConfig);
        rgb.addConfiguration(algorithm.getConfig());
View Full Code Here

    @Before
    public void createRecommender() throws RecommenderBuildException {
        LenskitConfiguration config = new LenskitConfiguration();
        config.addRoot(ItemDAO.class);
        config.bind(ItemDAO.class).to(FixedItemDAO.class);
        config.bind(EventDAO.class).to(EventCollectionDAO.create(Collections.<Rating>emptyList()));
        recommender = LenskitRecommender.build(config);
    }

    @Test
View Full Code Here

    @Before
    public void createRecommender() throws RecommenderBuildException {
        LenskitConfiguration config = new LenskitConfiguration();
        config.addRoot(ItemDAO.class);
        config.bind(ItemDAO.class).to(FixedItemDAO.class);
        config.bind(EventDAO.class).to(EventCollectionDAO.create(Collections.<Rating>emptyList()));
        recommender = LenskitRecommender.build(config);
    }

    @Test
    public void testAllItem() {
View Full Code Here

        @Override
        public LenskitConfiguration getConfiguration() {
            LenskitConfiguration config = new LenskitConfiguration();
            config.addComponent(BinaryRatingDAO.class);
            config.bind(BinaryRatingFile.class, File.class)
                  .to(inputFile);
            return config;
        }

        @Override
View Full Code Here

        rs.add(Ratings.make(1, 9, 3));
        rs.add(Ratings.make(3, 9, 4));

        dao = new EventCollectionDAO(rs);
        LenskitConfiguration config = new LenskitConfiguration();
        config.bind(PreferenceSnapshot.class).to(PackedPreferenceSnapshot.class);
        config.bind(ItemScorer.class).to(FunkSVDItemScorer.class);
        config.bind(BaselineScorer.class, ItemScorer.class)
              .to(UserMeanItemScorer.class);
        config.bind(Integer.class).withQualifier(FeatureCount.class).to(100);
        // FIXME: Don't use 100 features.
View Full Code Here

        rs.add(Ratings.make(3, 9, 4));

        dao = new EventCollectionDAO(rs);
        LenskitConfiguration config = new LenskitConfiguration();
        config.bind(PreferenceSnapshot.class).to(PackedPreferenceSnapshot.class);
        config.bind(ItemScorer.class).to(FunkSVDItemScorer.class);
        config.bind(BaselineScorer.class, ItemScorer.class)
              .to(UserMeanItemScorer.class);
        config.bind(Integer.class).withQualifier(FeatureCount.class).to(100);
        // FIXME: Don't use 100 features.
        RecommenderEngine engine = LenskitRecommenderEngine.build(config);
View Full Code Here

        dao = new EventCollectionDAO(rs);
        LenskitConfiguration config = new LenskitConfiguration();
        config.bind(PreferenceSnapshot.class).to(PackedPreferenceSnapshot.class);
        config.bind(ItemScorer.class).to(FunkSVDItemScorer.class);
        config.bind(BaselineScorer.class, ItemScorer.class)
              .to(UserMeanItemScorer.class);
        config.bind(Integer.class).withQualifier(FeatureCount.class).to(100);
        // FIXME: Don't use 100 features.
        RecommenderEngine engine = LenskitRecommenderEngine.build(config);
        svdRecommender = engine.createRecommender();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.