mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1372661 - in /mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste: impl/recommender/ impl/recommender/svd/ recommender/
Date Mon, 13 Aug 2012 23:06:07 GMT
Author: ssc
Date: Mon Aug 13 23:06:07 2012
New Revision: 1372661

URL: http://svn.apache.org/viewvc?rev=1372661&view=rev
Log:
MAHOUT-1057 CandidateItemsStrategies should be refreshable

Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/AbstractCandidateItemsStrategy.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/SVDRecommender.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/CandidateItemsStrategy.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/MostSimilarItemsCandidateItemsStrategy.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/AbstractCandidateItemsStrategy.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/AbstractCandidateItemsStrategy.java?rev=1372661&r1=1372660&r2=1372661&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/AbstractCandidateItemsStrategy.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/AbstractCandidateItemsStrategy.java
Mon Aug 13 23:06:07 2012
@@ -17,6 +17,7 @@
 
 package org.apache.mahout.cf.taste.impl.recommender;
 
+import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FastIDSet;
 import org.apache.mahout.cf.taste.model.DataModel;
@@ -24,6 +25,8 @@ import org.apache.mahout.cf.taste.model.
 import org.apache.mahout.cf.taste.recommender.CandidateItemsStrategy;
 import org.apache.mahout.cf.taste.recommender.MostSimilarItemsCandidateItemsStrategy;
 
+import java.util.Collection;
+
 /**
  * Abstract base implementation for retrieving candidate items to recommend
  */
@@ -42,4 +45,8 @@ public abstract class AbstractCandidateI
   }
 
   abstract FastIDSet doGetCandidateItems(long[] preferredItemIDs, DataModel dataModel) throws
TasteException;
+
+  @Override
+  public void refresh(Collection<Refreshable> alreadyRefreshed) {
+  }
 }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java?rev=1372661&r1=1372660&r2=1372661&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java
Mon Aug 13 23:06:07 2012
@@ -96,6 +96,8 @@ public class GenericItemBasedRecommender
     });
     refreshHelper.addDependency(dataModel);
     refreshHelper.addDependency(similarity);
+    refreshHelper.addDependency(candidateItemsStrategy);
+    refreshHelper.addDependency(mostSimilarItemsCandidateItemsStrategy);
     capper = buildCapper();
   }
 

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/SVDRecommender.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/SVDRecommender.java?rev=1372661&r1=1372660&r2=1372661&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/SVDRecommender.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/SVDRecommender.java
Mon Aug 13 23:06:07 2012
@@ -113,6 +113,7 @@ public final class SVDRecommender extend
     });
     refreshHelper.addDependency(getDataModel());
     refreshHelper.addDependency(factorizer);
+    refreshHelper.addDependency(candidateItemsStrategy);
   }
 
   static PersistenceStrategy getDefaultPersistenceStrategy() {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/CandidateItemsStrategy.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/CandidateItemsStrategy.java?rev=1372661&r1=1372660&r2=1372661&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/CandidateItemsStrategy.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/CandidateItemsStrategy.java
Mon Aug 13 23:06:07 2012
@@ -17,6 +17,7 @@
 
 package org.apache.mahout.cf.taste.recommender;
 
+import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FastIDSet;
 import org.apache.mahout.cf.taste.model.DataModel;
@@ -25,7 +26,7 @@ import org.apache.mahout.cf.taste.model.
 /**
  * Used to retrieve all items that could possibly be recommended to the user
  */
-public interface CandidateItemsStrategy {
+public interface CandidateItemsStrategy extends Refreshable {
 
   /**
    * @return IDs of all items that could be recommended to the user

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/MostSimilarItemsCandidateItemsStrategy.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/MostSimilarItemsCandidateItemsStrategy.java?rev=1372661&r1=1372660&r2=1372661&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/MostSimilarItemsCandidateItemsStrategy.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/MostSimilarItemsCandidateItemsStrategy.java
Mon Aug 13 23:06:07 2012
@@ -17,6 +17,7 @@
 
 package org.apache.mahout.cf.taste.recommender;
 
+import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FastIDSet;
 import org.apache.mahout.cf.taste.model.DataModel;
@@ -24,7 +25,7 @@ import org.apache.mahout.cf.taste.model.
 /**
  * Used to retrieve all items that could possibly be similar
  */
-public interface MostSimilarItemsCandidateItemsStrategy {
+public interface MostSimilarItemsCandidateItemsStrategy extends Refreshable {
 
   FastIDSet getCandidateItems(long[] itemIDs, DataModel dataModel) throws TasteException;
 }



Mime
View raw message