mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r771675 - in /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop: RecommenderJob.java RecommenderMapper.java
Date Tue, 05 May 2009 11:49:43 GMT
Author: srowen
Date: Tue May  5 11:49:41 2009
New Revision: 771675

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

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommenderJob.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommenderMapper.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommenderJob.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommenderJob.java?rev=771675&r1=771674&r2=771675&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommenderJob.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommenderJob.java
Tue May  5 11:49:41 2009
@@ -37,14 +37,14 @@
  * <p>Command line arguments are:</p>
  * <ol>
  *  <li>Fully-qualified class name of {@link Recommender} to use to make recommendations.
- *   Note that it must have a no-arg constructor.</li>
+ *   Note that it must have a constructor which takes a {@link org.apache.mahout.cf.taste.model.DataModel}
+ *   argument.</li>
  *  <li>Number of recommendations to compute per user</li>
  *  <li>Location of a text file containing user IDs for which recommendations should
be computed,
  *   one per line</li>
  *  <li>Location of a data model file containing preference data, suitable for use
with
  *   {@link org.apache.mahout.cf.taste.impl.model.file.FileDataModel}</li>
  *  <li>Output path where reducer output should go</li>
- *  <li>Number of mapper tasks to use</li>
  * </ol>
  *
  * <p>Example:</p>

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommenderMapper.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommenderMapper.java?rev=771675&r1=771674&r2=771675&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommenderMapper.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommenderMapper.java
Tue May  5 11:49:41 2009
@@ -45,14 +45,17 @@
  *
  * <p>Note that there is no corresponding {@link org.apache.hadoop.mapred.Reducer};
this
  * implementation can only partially take advantage of the mapreduce paradigm and only
- * really leverages it for easy parallelization.</p>
+ * really leverages it for easy parallelization. Therefore, use the
+ * {@link org.apache.hadoop.mapred.lib.IdentityReducer} when running this on Hadoop.</p>
+ *
+ * @see RecommenderJob
  */
 public final class RecommenderMapper
     extends MapReduceBase
     implements Mapper<LongWritable, Text, Text, RecommendedItemsWritable> {
 
   static final String RECOMMENDER_CLASS_NAME = "recommenderClassName";
-  static final String RECOMMENDATIONS_PER_USER = "recommendadtionsPerUser";
+  static final String RECOMMENDATIONS_PER_USER = "recommendationsPerUser";
   static final String DATA_MODEL_FILE = "dataModelFile";
 
   private Recommender recommender;
@@ -92,8 +95,10 @@
       throw new RuntimeException(ioe);
     }
     try {
-      Class<? extends Recommender> recommenderClass = Class.forName(recommenderClassName).asSubclass(Recommender.class);
-      Constructor<? extends Recommender> constructor = recommenderClass.getConstructor(DataModel.class);
+      Class<? extends Recommender> recommenderClass =
+          Class.forName(recommenderClassName).asSubclass(Recommender.class);
+      Constructor<? extends Recommender> constructor =
+          recommenderClass.getConstructor(DataModel.class);
       recommender = constructor.newInstance(fileDataModel);
     } catch (NoSuchMethodException nsme) {
       throw new RuntimeException(nsme);



Mime
View raw message