Package org.grouplens.lenskit.data.pref

Examples of org.grouplens.lenskit.data.pref.PreferenceDomain


public class PreferenceDomainQuantizerTest {
    PreferenceDomain domain;

    @Before
    public void setUp() {
        domain = new PreferenceDomain(0.5, 5.0, 0.5);
    }
View Full Code Here


        EventDAO dao = new EventCollectionDAO(rs);

        LenskitConfiguration config = new LenskitConfiguration();
        config.bind(EventDAO.class).to(dao);
        config.bind(ItemScorer.class).to(SlopeOneItemScorer.class);
        config.bind(PreferenceDomain.class).to(new PreferenceDomain(1, 5));
        // factory.setComponent(UserVectorNormalizer.class, IdentityVectorNormalizer.class);
        config.bind(BaselineScorer.class, ItemScorer.class)
              .to(UserMeanItemScorer.class);
        config.bind(UserMeanBaseline.class, ItemScorer.class)
              .to(ItemMeanRatingItemScorer.class);
View Full Code Here

     *
     * @see PreferenceDomain#PreferenceDomain(double, double, double)
     */
    @SuppressWarnings("unused")
    public PreferenceDomainQuantizer(double min, double max, double prec) {
        this(new PreferenceDomain(min, max, prec));
    }
View Full Code Here

    @Override
    public void configure(LenskitConfiguration config) {
        logger.debug("generating configuration for {}", this);
        config.addComponent(getEventDAO());
        PreferenceDomain dom = getPreferenceDomain();
        if (dom != null) {
            logger.debug("using preference domain {}", dom);
            config.addComponent(dom);
        }
        config.bind(PrefetchingUserDAO.class)
View Full Code Here

    @Override
    public void configure(LenskitConfiguration config) {
        Provider<BinaryRatingDAO> provider = new DAOProvider();
        config.bind(BinaryRatingDAO.class).toProvider(provider);
        PreferenceDomain dom = getPreferenceDomain();
        if (dom != null) {
            config.addComponent(dom);
        }
    }
View Full Code Here

        ItemScorer scorer = PrecomputedItemScorer.newBuilder()
                                          .addScore(40, 1, 4.0)
                                          .addScore(40, 2, 5.5)
                                          .addScore(40, 3, -1)
                                          .build();
        PreferenceDomain domain = new PreferenceDomain(1, 5, 1);
        pred = new SimpleRatingPredictor(scorer, null, domain);
        unclamped = new SimpleRatingPredictor(scorer, null, null);
    }
View Full Code Here

    private LenskitConfiguration makeDataConfig() {
        LenskitConfiguration config = new LenskitConfiguration();
        config.bind(EventDAO.class).toProvider(new DAOProvider());
        String dspec = options.getString("domain");
        if (dspec != null) {
            PreferenceDomain domain = PreferenceDomain.fromString(dspec);
            config.bind(PreferenceDomain.class).to(domain);
        }
        return config;
    }
View Full Code Here

     * @param args The arguments.
     * @return The preference domain.
     * @see #prefDomain(java.util.Map)
     */
    public PreferenceDomain domain(Map<String,Object> args) {
        PreferenceDomain dom = prefDomain(args);
        bind(PreferenceDomain.class).to(dom);
        return dom;
    }
View Full Code Here

     */
    public void prepare(int feature, double rating, double estimate,
                        double uv, double iv, double trail) {
        // Compute prediction
        double pred = estimate + uv * iv;
        PreferenceDomain dom = updateRule.getDomain();
        if (dom != null) {
            pred = dom.clampValue(pred);
        }
        pred += trail;

        // Compute the err and store this value
        error = rating - pred;
View Full Code Here

TOP

Related Classes of org.grouplens.lenskit.data.pref.PreferenceDomain

Copyright © 2018 www.massapicom. 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.