mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r771673 - /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/BooleanUserGenericUserBasedRecommender.java
Date Tue, 05 May 2009 11:43:08 GMT
Author: srowen
Date: Tue May  5 11:43:05 2009
New Revision: 771673

URL: http://svn.apache.org/viewvc?rev=771673&view=rev
Log: (empty)

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

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/BooleanUserGenericUserBasedRecommender.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/BooleanUserGenericUserBasedRecommender.java?rev=771673&r1=771672&r2=771673&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/BooleanUserGenericUserBasedRecommender.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/BooleanUserGenericUserBasedRecommender.java
Tue May  5 11:43:05 2009
@@ -176,7 +176,6 @@
     if (theNeighborhood.isEmpty()) {
       return Double.NaN;
     }
-    double preference = 0.0;
     double totalSimilarity = 0.0;
     for (User user : theNeighborhood) {
       if (!user.equals(theUser)) {
@@ -185,13 +184,12 @@
         if (pref != null) {
           double theSimilarity = similarity.userSimilarity(theUser, user) + 1.0;
           if (!Double.isNaN(theSimilarity)) {
-            preference += theSimilarity * pref.getValue();
             totalSimilarity += theSimilarity;
           }
         }
       }
     }
-    return totalSimilarity == 0.0 ? Double.NaN : preference / totalSimilarity;
+    return totalSimilarity == 0.0 ? Double.NaN : totalSimilarity;
   }
 
   private static Set<Object> getAllOtherItems(Iterable<User> theNeighborhood,
User theUser) {



Mime
View raw message