@@ -0,0 +1,1613 @@
+package org.grouplens.lenskit.transform.quantize;%0A%0Aimport org.grouplens.lenskit.RatingPredictor;%0Aimport org.grouplens.lenskit.core.AbstractItemScorer;%0Aimport org.grouplens.lenskit.data.Event;%0Aimport org.grouplens.lenskit.data.UserHistory;%0Aimport org.grouplens.lenskit.data.dao.DataAccessObject;%0Aimport org.grouplens.lenskit.vectors.MutableSparseVector;%0Aimport org.grouplens.lenskit.vectors.VectorEntry;%0A%0Aimport javax.annotation.Nonnull;%0Aimport javax.inject.Inject;%0A%0A/**%0A * A rating predictor wrapper that quantizes predictions.%0A * @author Michael Ekstrand%0A */%0Apublic class QuantizedRatingPredictor extends AbstractItemScorer implements RatingPredictor %7B%0A    private RatingPredictor basePredictor;%0A    private Quantizer quantizer;%0A%0A    /**%0A     * Construct a new quantized predictor.%0A     * @param dao The DAO.%0A     * @param base The base predictor.%0A     * @param q The quantizer.%0A     */%0A    @Inject%0A    public QuantizedRatingPredictor(DataAccessObject dao, RatingPredictor base, Quantizer q) %7B%0A        super(dao);%0A        basePredictor = base;%0A        quantizer = q;%0A    %7D%0A%0A    @Override%0A    public void score(long user, @Nonnull MutableSparseVector scores) %7B%0A        basePredictor.score(user, scores);%0A        for (VectorEntry e: scores.fast()) %7B%0A            scores.set(e, quantizer.apply(e.getValue()));%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void score(@Nonnull UserHistory%3C? extends Event%3E profile, @Nonnull MutableSparseVector scores) %7B%0A        basePredictor.score(profile, scores);%0A        for (VectorEntry e: scores.fast()) %7B%0A            scores.set(e, quantizer.apply(e.getValue()));%0A        %7D%0A    %7D%0A%7D%0A

Add quantized rating predictor.