You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by sr...@apache.org on 2010/09/16 10:13:16 UTC
svn commit: r997637 -
/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java
Author: srowen
Date: Thu Sep 16 08:13:16 2010
New Revision: 997637
URL: http://svn.apache.org/viewvc?rev=997637&view=rev
Log:
Don't limit number of recs stored per cluster
Modified:
mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java
Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java?rev=997637&r1=997636&r2=997637&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java Thu Sep 16 08:13:16 2010
@@ -63,7 +63,6 @@ public final class TreeClusteringRecomme
private static final Logger log = LoggerFactory.getLogger(TreeClusteringRecommender.class);
- private static final int NUM_CLUSTER_RECS = 100;
private static final FastIDSet[] NO_CLUSTERS = new FastIDSet[0];
private static final Random RANDOM = RandomUtils.getRandom();
@@ -363,7 +362,8 @@ public final class TreeClusteringRecomme
return nearestPair;
}
- private FastByIDMap<List<RecommendedItem>> computeTopRecsPerUserID(List<FastIDSet> clusters) throws TasteException {
+ private FastByIDMap<List<RecommendedItem>> computeTopRecsPerUserID(Iterable<FastIDSet> clusters)
+ throws TasteException {
FastByIDMap<List<RecommendedItem>> recsPerUser = new FastByIDMap<List<RecommendedItem>>();
for (FastIDSet cluster : clusters) {
List<RecommendedItem> recs = computeTopRecsForCluster(cluster);
@@ -385,8 +385,8 @@ public final class TreeClusteringRecomme
TopItems.Estimator<Long> estimator = new Estimator(cluster);
- List<RecommendedItem> topItems = TopItems.getTopItems(NUM_CLUSTER_RECS,
- possibleItemIDs.iterator(), null, estimator);
+ List<RecommendedItem> topItems =
+ TopItems.getTopItems(possibleItemIDs.size(), possibleItemIDs.iterator(), null, estimator);
log.debug("Recommendations are: {}", topItems);
return Collections.unmodifiableList(topItems);