mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1459418 - in /mahout/trunk: core/src/main/java/org/apache/mahout/cf/taste/hadoop/ core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ core/src/main/java/org/apache/mahout/cf/...
Date Thu, 21 Mar 2013 17:37:51 GMT
Author: ssc
Date: Thu Mar 21 17:37:50 2013
New Revision: 1459418

URL: http://svn.apache.org/r1459418
Log:
cleanup and fixes

Added:
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/PredictionMapper.java
      - copied, changed from r1459365, mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingPredictionMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SolveExplicitFeedbackMapper.java
      - copied, changed from r1458754, mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingSolveExplicitFeedbackMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SolveImplicitFeedbackMapper.java
      - copied, changed from r1458754, mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingSolveImplicitFeedbackMapper.java
Removed:
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityCountWritable.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityPrefWritableArrayWritable.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/ToUserPrefsMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingPredictionMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingSolveExplicitFeedbackMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingSolveImplicitFeedbackMapper.java
Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityEntityWritable.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityPrefWritable.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ALS.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/FactorizationEvaluator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/MutableRecommendedItem.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/RecommenderJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/TopItemQueue.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/AggregateAndRecommendReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorOrPrefWritable.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/preparation/ToItemVectorsReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/RecommenderReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/UserIDsMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/FullRunningAverageAndStdDevWritable.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOneDiffsToAveragesReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOnePrefsToDiffsReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/similarity/precompute/BatchItemSimilarities.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/cooccurrence/RowSimilarityJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/cooccurrence/Vectors.java
    mahout/trunk/math/src/main/java/org/apache/mahout/math/als/AlternatingLeastSquaresSolver.java
    mahout/trunk/math/src/main/java/org/apache/mahout/math/als/ImplicitFeedbackAlternatingLeastSquaresSolver.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityEntityWritable.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityEntityWritable.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityEntityWritable.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityEntityWritable.java
Thu Mar 21 17:37:50 2013
@@ -26,8 +26,7 @@ import org.apache.hadoop.io.WritableComp
 import org.apache.mahout.math.Varint;
 
 /** A {@link WritableComparable} encapsulating two items. */
-public final class EntityEntityWritable
-    implements WritableComparable<EntityEntityWritable>, Cloneable {
+public final class EntityEntityWritable implements WritableComparable<EntityEntityWritable>,
Cloneable {
   
   private long aID;
   private long bID;
@@ -41,19 +40,14 @@ public final class EntityEntityWritable
     this.bID = bID;
   }
   
-  public long getAID() {
+  long getAID() {
     return aID;
   }
   
-  public long getBID() {
+  long getBID() {
     return bID;
   }
 
-  public void set(long aID, long bID) {
-    this.aID = aID;
-    this.bID = bID;
-  }
-  
   @Override
   public void write(DataOutput out) throws IOException {
     Varint.writeSignedVarLong(aID, out);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityPrefWritable.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityPrefWritable.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityPrefWritable.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/EntityPrefWritable.java
Thu Mar 21 17:37:50 2013
@@ -50,11 +50,6 @@ public final class EntityPrefWritable ex
     return prefValue;
   }
 
-  public void set(long id, float prefValue) {
-    set(id);
-    this.prefValue = prefValue;
-  }
-  
   @Override
   public void write(DataOutput out) throws IOException {
     super.write(out);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ALS.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ALS.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ALS.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ALS.java Thu Mar
21 17:37:50 2013
@@ -21,7 +21,6 @@ import com.google.common.collect.Lists;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.IntWritable;
-import org.apache.hadoop.mapreduce.Mapper;
 import org.apache.mahout.common.Pair;
 import org.apache.mahout.common.iterator.sequencefile.PathFilters;
 import org.apache.mahout.common.iterator.sequencefile.PathType;
@@ -36,10 +35,9 @@ import java.io.IOException;
 import java.util.Iterator;
 import java.util.List;
 
-public final class ALS {
+final class ALS {
 
-  private ALS() {
-  }
+  private ALS() {}
 
   static Vector readFirstRow(Path dir, Configuration conf) throws IOException {
     Iterator<VectorWritable> iterator = new SequenceFileDirValueIterator<VectorWritable>(dir,
PathType.LIST,
@@ -60,7 +58,7 @@ public final class ALS {
   }
 
   public static Vector solveExplicit(VectorWritable ratingsWritable, OpenIntObjectHashMap<Vector>
uOrM,
-    double lambda, int numFeatures) throws IOException, InterruptedException {
+    double lambda, int numFeatures) {
     Vector ratings = ratingsWritable.get();
 
     List<Vector> featureVectors = Lists.newArrayListWithCapacity(ratings.getNumNondefaultElements());

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/FactorizationEvaluator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/FactorizationEvaluator.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/FactorizationEvaluator.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/FactorizationEvaluator.java
Thu Mar 21 17:37:50 2013
@@ -108,7 +108,7 @@ public class FactorizationEvaluator exte
     return 0;
   }
 
-  protected double computeRmse(Path errors) {
+  double computeRmse(Path errors) {
     RunningAverage average = new FullRunningAverage();
     for (Pair<DoubleWritable,NullWritable> entry :
       new SequenceFileDirIterable<DoubleWritable, NullWritable>(errors, PathType.LIST,
PathFilters.logsCRCFilter(),

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/MutableRecommendedItem.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/MutableRecommendedItem.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/MutableRecommendedItem.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/MutableRecommendedItem.java
Thu Mar 21 17:37:50 2013
@@ -50,10 +50,6 @@ class MutableRecommendedItem implements 
     }
   }
 
-  public RecommendedItem copy() {
-    return new GenericRecommendedItem(itemID, value);
-  }
-
   @Override
   public String toString() {
     return "MutableRecommendedItem[item:" + itemID + ", value:" + value + ']';

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java
Thu Mar 21 17:37:50 2013
@@ -235,15 +235,15 @@ public class ParallelALSFactorizationJob
       throws ClassNotFoundException, IOException, InterruptedException {
 
     int iterationNumber = currentIteration + 1;
-    Class<? extends Mapper<IntWritable,VectorWritable,IntWritable,VectorWritable>>
solverMapperClassInternal = null;
-    String name = null;
+    Class<? extends Mapper<IntWritable,VectorWritable,IntWritable,VectorWritable>>
solverMapperClassInternal;
+    String name;
 
     if (implicitFeedback) {
-      solverMapperClassInternal = SharingSolveImplicitFeedbackMapper.class;
+      solverMapperClassInternal = SolveImplicitFeedbackMapper.class;
       name = "Recompute " + matrixName +", iteration (" + iterationNumber + "/" + numIterations
+ "), " +
           "(" + numThreadsPerSolver + " threads, implicit feedback)";
     } else {
-      solverMapperClassInternal = SharingSolveExplicitFeedbackMapper.class;
+      solverMapperClassInternal = SolveExplicitFeedbackMapper.class;
       name = "Recompute " + matrixName +", iteration (" + iterationNumber + "/" + numIterations
+ "), " +
           "(" + numThreadsPerSolver + " threads, explicit feedback)";
     }

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/PredictionMapper.java
(from r1459365, mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingPredictionMapper.java)
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/PredictionMapper.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/PredictionMapper.java&p1=mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingPredictionMapper.java&r1=1459365&r2=1459418&rev=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingPredictionMapper.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/PredictionMapper.java
Thu Mar 21 17:37:50 2013
@@ -36,7 +36,7 @@ import java.util.List;
  * a multithreaded mapper that loads the feature matrices U and M into memory. Afterwards
it computes recommendations
  * from these. Can be executed by a {@link MultithreadedSharingMapper}.
  */
-class SharingPredictionMapper extends SharingMapper<IntWritable,VectorWritable,IntWritable,RecommendedItemsWritable,
+public class PredictionMapper extends SharingMapper<IntWritable,VectorWritable,IntWritable,RecommendedItemsWritable,
     Pair<OpenIntObjectHashMap<Vector>,OpenIntObjectHashMap<Vector>>>
{
 
   private int recommendationsPerUser;

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/RecommenderJob.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/RecommenderJob.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/RecommenderJob.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/RecommenderJob.java
Thu Mar 21 17:37:50 2013
@@ -84,7 +84,7 @@ public class RecommenderJob extends Abst
     conf.set(ITEM_FEATURES_PATH, getOption("itemFeatures"));
     conf.set(MAX_RATING, getOption("maxRating"));
 
-    MultithreadedMapper.setMapperClass(prediction, SharingPredictionMapper.class);
+    MultithreadedMapper.setMapperClass(prediction, PredictionMapper.class);
     MultithreadedMapper.setNumberOfThreads(prediction, numThreads);
 
     boolean succeeded = prediction.waitForCompletion(true);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingMapper.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingMapper.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingMapper.java
Thu Mar 21 17:37:50 2013
@@ -37,7 +37,7 @@ public abstract class SharingMapper<K1,V
   /**
    * Called before the multithreaded execution
    *
-   * @param context
+   * @param context mapper's context
    */
   abstract S createSharedInstance(Context context);
 
@@ -45,7 +45,7 @@ public abstract class SharingMapper<K1,V
     SHARED_INSTANCE = createSharedInstance(context);
   }
 
-  protected final S getSharedInstance() {
+  final S getSharedInstance() {
     return (S) SHARED_INSTANCE;
   }
 }

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SolveExplicitFeedbackMapper.java
(from r1458754, mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingSolveExplicitFeedbackMapper.java)
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SolveExplicitFeedbackMapper.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SolveExplicitFeedbackMapper.java&p1=mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingSolveExplicitFeedbackMapper.java&r1=1458754&r2=1459418&rev=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingSolveExplicitFeedbackMapper.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SolveExplicitFeedbackMapper.java
Thu Mar 21 17:37:50 2013
@@ -29,12 +29,12 @@ import org.apache.mahout.math.map.OpenIn
 import java.io.IOException;
 
 /** Solving mapper that can be safely executed using multiple threads */
-public class SharingSolveExplicitFeedbackMapper
+public class SolveExplicitFeedbackMapper
     extends SharingMapper<IntWritable,VectorWritable,IntWritable,VectorWritable,OpenIntObjectHashMap<Vector>>
{
 
   private double lambda;
   private int numFeatures;
-  private VectorWritable uiOrmj = new VectorWritable();
+  private final VectorWritable uiOrmj = new VectorWritable();
 
   @Override
   OpenIntObjectHashMap<Vector> createSharedInstance(Context ctx) {

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SolveImplicitFeedbackMapper.java
(from r1458754, mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingSolveImplicitFeedbackMapper.java)
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SolveImplicitFeedbackMapper.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SolveImplicitFeedbackMapper.java&p1=mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingSolveImplicitFeedbackMapper.java&r1=1458754&r2=1459418&rev=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SharingSolveImplicitFeedbackMapper.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/SolveImplicitFeedbackMapper.java
Thu Mar 21 17:37:50 2013
@@ -27,7 +27,7 @@ import org.apache.mahout.math.als.Implic
 import java.io.IOException;
 
 /** Solving mapper that can be safely executed using multiple threads */
-public class SharingSolveImplicitFeedbackMapper
+public class SolveImplicitFeedbackMapper
     extends SharingMapper<IntWritable,VectorWritable,IntWritable,VectorWritable,
     ImplicitFeedbackAlternatingLeastSquaresSolver> {
 

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/TopItemQueue.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/TopItemQueue.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/TopItemQueue.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/TopItemQueue.java
Thu Mar 21 17:37:50 2013
@@ -26,7 +26,7 @@ import java.util.List;
 
 public class TopItemQueue extends PriorityQueue<MutableRecommendedItem> {
 
-  public static final long SENTINEL_ID = Long.MIN_VALUE;
+  private static final long SENTINEL_ID = Long.MIN_VALUE;
 
   private final int maxSize;
 

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/AggregateAndRecommendReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/AggregateAndRecommendReducer.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/AggregateAndRecommendReducer.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/AggregateAndRecommendReducer.java
Thu Mar 21 17:37:50 2013
@@ -99,13 +99,6 @@ public final class AggregateAndRecommend
     }
   }
 
-  private static final DoubleFunction ABSOLUTE_VALUES = new DoubleFunction() {
-    @Override
-    public double apply(double value) {
-      return value < 0 ? value * -1 : value;
-    }
-  };
-
   @Override
   protected void reduce(VarLongWritable userID,
                         Iterable<PrefAndSimilarityColumnWritable> values,
@@ -163,11 +156,10 @@ public final class AggregateAndRecommend
           numerators.assign(Functions.MULT, prefValue);
         }
       } else {
-        Vector toAdd = simColumn;
         if (prefValue != BOOLEAN_PREF_VALUE) {
-          toAdd.assign(Functions.MULT, prefValue);
+          simColumn.assign(Functions.MULT, prefValue);
         }
-        numerators.assign(toAdd, Functions.PLUS);
+        numerators.assign(simColumn, Functions.PLUS);
       }
 
     }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorOrPrefWritable.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorOrPrefWritable.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorOrPrefWritable.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorOrPrefWritable.java
Thu Mar 21 17:37:50 2013
@@ -57,7 +57,7 @@ public final class VectorOrPrefWritable 
     return value;
   }
 
-  public void set(Vector vector) {
+  void set(Vector vector) {
     this.vector = vector;
     this.userID = Long.MIN_VALUE;
     this.value = Float.NaN;

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/preparation/ToItemVectorsReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/preparation/ToItemVectorsReducer.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/preparation/ToItemVectorsReducer.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/preparation/ToItemVectorsReducer.java
Thu Mar 21 17:37:50 2013
@@ -23,7 +23,7 @@ import org.apache.mahout.math.VectorWrit
 
 import java.io.IOException;
 
-public class ToItemVectorsReducer extends Reducer<IntWritable,VectorWritable,IntWritable,VectorWritable>
{
+class ToItemVectorsReducer extends Reducer<IntWritable,VectorWritable,IntWritable,VectorWritable>
{
 
   @Override
   protected void reduce(IntWritable row, Iterable<VectorWritable> vectors, Context
ctx)

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/RecommenderReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/RecommenderReducer.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/RecommenderReducer.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/RecommenderReducer.java
Thu Mar 21 17:37:50 2013
@@ -46,7 +46,7 @@ import org.apache.mahout.math.VarLongWri
  * 
  * @see RecommenderJob
  */
-public final class RecommenderReducer extends
+final class RecommenderReducer extends
     Reducer<VarLongWritable,NullWritable,VarLongWritable,RecommendedItemsWritable>
{
   
   static final String RECOMMENDER_CLASS_NAME = "recommenderClassName";

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/UserIDsMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/UserIDsMapper.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/UserIDsMapper.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/UserIDsMapper.java
Thu Mar 21 17:37:50 2013
@@ -29,7 +29,7 @@ import org.apache.mahout.math.VarLongWri
 /**
  * Extracts and emits all user IDs from the users file, or input file.
  */
-public final class UserIDsMapper extends
+final class UserIDsMapper extends
     Mapper<LongWritable,Text, VarLongWritable,NullWritable> {
 
   private static final Pattern DELIMITER = Pattern.compile("[\t,]");

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/FullRunningAverageAndStdDevWritable.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/FullRunningAverageAndStdDevWritable.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/FullRunningAverageAndStdDevWritable.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/FullRunningAverageAndStdDevWritable.java
Thu Mar 21 17:37:50 2013
@@ -25,17 +25,13 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 
-public final class FullRunningAverageAndStdDevWritable implements Writable {
+final class FullRunningAverageAndStdDevWritable implements Writable {
   
   private FullRunningAverageAndStdDev average;
   
   public FullRunningAverageAndStdDevWritable(FullRunningAverageAndStdDev average) {
     this.average = average;
   }
-  
-  public FullRunningAverageAndStdDev getAverage() {
-    return average;
-  }
 
   @Override
   public String toString() {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOneDiffsToAveragesReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOneDiffsToAveragesReducer.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOneDiffsToAveragesReducer.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOneDiffsToAveragesReducer.java
Thu Mar 21 17:37:50 2013
@@ -24,7 +24,7 @@ import org.apache.hadoop.mapreduce.Reduc
 import org.apache.mahout.cf.taste.hadoop.EntityEntityWritable;
 import org.apache.mahout.cf.taste.impl.common.FullRunningAverageAndStdDev;
 
-public final class SlopeOneDiffsToAveragesReducer extends
+final class SlopeOneDiffsToAveragesReducer extends
     Reducer<EntityEntityWritable,FloatWritable,EntityEntityWritable,FullRunningAverageAndStdDevWritable>
{
   
   @Override

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOnePrefsToDiffsReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOnePrefsToDiffsReducer.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOnePrefsToDiffsReducer.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOnePrefsToDiffsReducer.java
Thu Mar 21 17:37:50 2013
@@ -28,7 +28,7 @@ import org.apache.mahout.cf.taste.hadoop
 import org.apache.mahout.cf.taste.hadoop.EntityPrefWritable;
 import org.apache.mahout.math.VarLongWritable;
 
-public final class SlopeOnePrefsToDiffsReducer extends
+final class SlopeOnePrefsToDiffsReducer extends
     Reducer<VarLongWritable,EntityPrefWritable,EntityEntityWritable,FloatWritable>
{
   
   @Override

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/similarity/precompute/BatchItemSimilarities.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/similarity/precompute/BatchItemSimilarities.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/similarity/precompute/BatchItemSimilarities.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/similarity/precompute/BatchItemSimilarities.java
Thu Mar 21 17:37:50 2013
@@ -23,8 +23,8 @@ import java.io.IOException;
 
 public abstract class BatchItemSimilarities {
 
-  private ItemBasedRecommender recommender;
-  private int similarItemsPerItem;
+  private final ItemBasedRecommender recommender;
+  private final int similarItemsPerItem;
 
   /**
    * @param recommender recommender to use

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/cooccurrence/RowSimilarityJob.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/cooccurrence/RowSimilarityJob.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/cooccurrence/RowSimilarityJob.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/cooccurrence/RowSimilarityJob.java
Thu Mar 21 17:37:50 2013
@@ -51,16 +51,16 @@ public class RowSimilarityJob extends Ab
 
   public static final double NO_THRESHOLD = Double.MIN_VALUE;
 
-  static final String SIMILARITY_CLASSNAME = RowSimilarityJob.class + ".distributedSimilarityClassname";
-  static final String NUMBER_OF_COLUMNS = RowSimilarityJob.class + ".numberOfColumns";
-  static final String MAX_SIMILARITIES_PER_ROW = RowSimilarityJob.class + ".maxSimilaritiesPerRow";
-  static final String EXCLUDE_SELF_SIMILARITY = RowSimilarityJob.class + ".excludeSelfSimilarity";
-
-  static final String THRESHOLD = RowSimilarityJob.class + ".threshold";
-  static final String NORMS_PATH = RowSimilarityJob.class + ".normsPath";
-  static final String MAXVALUES_PATH = RowSimilarityJob.class + ".maxWeightsPath";
+  private static final String SIMILARITY_CLASSNAME = RowSimilarityJob.class + ".distributedSimilarityClassname";
+  private static final String NUMBER_OF_COLUMNS = RowSimilarityJob.class + ".numberOfColumns";
+  private static final String MAX_SIMILARITIES_PER_ROW = RowSimilarityJob.class + ".maxSimilaritiesPerRow";
+  private static final String EXCLUDE_SELF_SIMILARITY = RowSimilarityJob.class + ".excludeSelfSimilarity";
+
+  private static final String THRESHOLD = RowSimilarityJob.class + ".threshold";
+  private static final String NORMS_PATH = RowSimilarityJob.class + ".normsPath";
+  private static final String MAXVALUES_PATH = RowSimilarityJob.class + ".maxWeightsPath";
 
-  static final String NUM_NON_ZERO_ENTRIES_PATH = RowSimilarityJob.class + ".nonZeroEntriesPath";
+  private static final String NUM_NON_ZERO_ENTRIES_PATH = RowSimilarityJob.class + ".nonZeroEntriesPath";
   private static final int DEFAULT_MAX_SIMILARITIES_PER_ROW = 100;
 
   private static final int NORM_VECTOR_MARKER = Integer.MIN_VALUE;
@@ -240,7 +240,7 @@ public class RowSimilarityJob extends Ab
     }
   }
 
-  public static class MergeVectorsCombiner extends Reducer<IntWritable,VectorWritable,IntWritable,VectorWritable>
{
+  private static class MergeVectorsCombiner extends Reducer<IntWritable,VectorWritable,IntWritable,VectorWritable>
{
     @Override
     protected void reduce(IntWritable row, Iterable<VectorWritable> partialVectors,
Context ctx)
       throws IOException, InterruptedException {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/cooccurrence/Vectors.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/cooccurrence/Vectors.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/cooccurrence/Vectors.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/cooccurrence/Vectors.java
Thu Mar 21 17:37:50 2013
@@ -165,7 +165,7 @@ public final class Vectors {
   }
 
   /* ugly optimization for loading sparse vectors containing ints only */
-  public static OpenIntIntHashMap readAsIntMap(DataInput in) throws IOException {
+  private static OpenIntIntHashMap readAsIntMap(DataInput in) throws IOException {
     int flags = in.readByte();
     Preconditions.checkArgument(flags >> VectorWritable.NUM_FLAGS == 0,
                                 "Unknown flags set: %d", Integer.toString(flags, 2));

Modified: mahout/trunk/math/src/main/java/org/apache/mahout/math/als/AlternatingLeastSquaresSolver.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/main/java/org/apache/mahout/math/als/AlternatingLeastSquaresSolver.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/math/src/main/java/org/apache/mahout/math/als/AlternatingLeastSquaresSolver.java
(original)
+++ mahout/trunk/math/src/main/java/org/apache/mahout/math/als/AlternatingLeastSquaresSolver.java
Thu Mar 21 17:37:50 2013
@@ -33,8 +33,7 @@ import java.util.Iterator;
  */
 public final class AlternatingLeastSquaresSolver {
 
-  private AlternatingLeastSquaresSolver() {
-  }
+  private AlternatingLeastSquaresSolver() {}
 
   //TODO make feature vectors a simple array
   public static Vector solve(Iterable<Vector> featureVectors, Vector ratingVector,
double lambda, int numFeatures) {
@@ -58,7 +57,7 @@ public final class AlternatingLeastSquar
     return solve(Ai, Vi);
   }
 
-  static Vector solve(Matrix Ai, Matrix Vi) {
+  private static Vector solve(Matrix Ai, Matrix Vi) {
     return new QRDecomposition(Ai).solve(Vi).viewColumn(0);
   }
 
@@ -72,7 +71,7 @@ public final class AlternatingLeastSquar
     return matrix;
   }
 
-  static Matrix MiTimesMiTransposePlusLambdaTimesNuiTimesE(Matrix MiIi, double lambda, int
nui) {
+  private static Matrix MiTimesMiTransposePlusLambdaTimesNuiTimesE(Matrix MiIi, double lambda,
int nui) {
 
     double lambdaTimesNui = lambda * nui;
     int rows = MiIi.numRows();

Modified: mahout/trunk/math/src/main/java/org/apache/mahout/math/als/ImplicitFeedbackAlternatingLeastSquaresSolver.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/main/java/org/apache/mahout/math/als/ImplicitFeedbackAlternatingLeastSquaresSolver.java?rev=1459418&r1=1459417&r2=1459418&view=diff
==============================================================================
--- mahout/trunk/math/src/main/java/org/apache/mahout/math/als/ImplicitFeedbackAlternatingLeastSquaresSolver.java
(original)
+++ mahout/trunk/math/src/main/java/org/apache/mahout/math/als/ImplicitFeedbackAlternatingLeastSquaresSolver.java
Thu Mar 21 17:37:50 2013
@@ -57,7 +57,7 @@ public class ImplicitFeedbackAlternating
     return new QRDecomposition(A).solve(y).viewColumn(0);
   }
 
-  protected double confidence(double rating) {
+  double confidence(double rating) {
     return 1 + alpha * rating;
   }
 



Mime
View raw message