mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r751485 - /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java
Date Sun, 08 Mar 2009 18:00:24 GMT
Author: srowen
Date: Sun Mar  8 18:00:23 2009
New Revision: 751485

URL: http://svn.apache.org/viewvc?rev=751485&view=rev
Log:
Enable new speedup for slope one that excludes items from consideration that can never be
recommended since they don't co-occur with another item

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java?rev=751485&r1=751484&r2=751485&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java
Sun Mar  8 18:00:23 2009
@@ -204,25 +204,14 @@
   @Override
   public Set<Item> getRecommendableItems(Object userID) throws TasteException {
     User user = dataModel.getUser(userID);
-    Set<Item> result = new FastSet<Item>(dataModel.getNumItems());
-    for (Item item : dataModel.getItems()) {
-      // If not already preferred by the user, add it
-      if (user.getPreferenceFor(item.getID()) == null) {
-        result.add(item);
-      }
-    }
-    return result;
-    /*
-    User user = dataModel.getUser(userID);
     Set<Item> result = allRecommendableItemIDs.clone();
     Iterator<Item> it = result.iterator();
     while (it.hasNext()) {
-      if (user.getPreferenceFor(it.next().getID()) == null) {
+      if (user.getPreferenceFor(it.next().getID()) != null) {
         it.remove();
       }
     }
     return result;
-     */
   }
 
   private void buildAverageDiffs() throws TasteException {



Mime
View raw message