Package org.grouplens.lenskit.util

Examples of org.grouplens.lenskit.util.IdMeanAccumulator


            final double globalMean;

            logger.debug("computing item mean ratings");
            Cursor<Rating> ratings = dao.streamEvents(Rating.class);
            try {
                IdMeanAccumulator accum = new IdMeanAccumulator();
                for (Rating r: ratings) {
                    Preference p = r.getPreference();
                    if (p != null) {
                        accum.put(p.getItemId(), p.getValue());
                    }
                }
                globalMean = accum.globalMean();
                itemMeans = accum.idMeanOffsets(damping);
            } finally {
                ratings.close();
            }
            logger.debug("computed means for {} items", itemMeans.size());
            logger.debug("global mean rating is {}", globalMean);
View Full Code Here

TOP

Related Classes of org.grouplens.lenskit.util.IdMeanAccumulator

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.