mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r1131346 - in /mahout/trunk/core/src/main/java/org/apache/mahout: cf/taste/hadoop/item/ math/hadoop/ math/hadoop/similarity/
Date Sat, 04 Jun 2011 08:22:34 GMT
Author: srowen
Date: Sat Jun  4 08:22:33 2011
New Revision: 1131346

URL: http://svn.apache.org/viewvc?rev=1131346&view=rev
Log:
MAHOUT-721 more toString() for writables

Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.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/math/hadoop/DistributedRowMatrix.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrence.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrenceArray.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java?rev=1131346&r1=1131345&r2=1131346&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java
Sat Jun  4 08:22:33 2011
@@ -81,4 +81,8 @@ public final class VectorAndPrefsWritabl
     }
   }
 
+  @Override
+  public String toString() {
+    return vector + "\t" + userIDs + "\t" + values;
+  }
 }
\ No newline at end of file

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=1131346&r1=1131345&r2=1131346&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
Sat Jun  4 08:22:33 2011
@@ -97,4 +97,8 @@ public final class VectorOrPrefWritable 
     }
   }
 
+  @Override
+  public String toString() {
+    return vector == null ? userID + ":" + value : vector.toString();
+  }
 }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/DistributedRowMatrix.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/DistributedRowMatrix.java?rev=1131346&r1=1131345&r2=1131346&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/DistributedRowMatrix.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/DistributedRowMatrix.java
Sat Jun  4 08:22:33 2011
@@ -319,6 +319,10 @@ public class DistributedRowMatrix implem
       col = in.readInt();
       val = in.readDouble();
     }
+    
+    @Override
+    public String toString() {
+      return "(" + row + "," + col + "):" + val;
+    }
   }
-
 }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java?rev=1131346&r1=1131345&r2=1131346&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java
Sat Jun  4 08:22:33 2011
@@ -86,6 +86,11 @@ public class SimilarityMatrixEntryKey im
     return other instanceof SimilarityMatrixEntryKey && row == ((SimilarityMatrixEntryKey)
other).row;
   }
 
+  @Override
+  public String toString() {
+    return row + ":" + value;
+  }
+  
   public static class SimilarityMatrixEntryKeyComparator extends WritableComparator implements
Serializable {
 
     protected SimilarityMatrixEntryKeyComparator() {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrence.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrence.java?rev=1131346&r1=1131345&r2=1131346&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrence.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrence.java
Sat Jun  4 08:22:33 2011
@@ -82,4 +82,9 @@ class WeightedOccurrence implements Writ
   public boolean equals(Object other) {
     return other instanceof WeightedOccurrence && row == ((WeightedOccurrence) other).row;
   }
+  
+  @Override
+  public String toString() {
+    return row + ":" + value + "(" + weight + ")";
+  }
 }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrenceArray.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrenceArray.java?rev=1131346&r1=1131345&r2=1131346&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrenceArray.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrenceArray.java
Sat Jun  4 08:22:33 2011
@@ -17,6 +17,8 @@
 
 package org.apache.mahout.math.hadoop.similarity;
 
+import java.util.Arrays;
+
 import org.apache.hadoop.io.ArrayWritable;
 
 /**
@@ -36,4 +38,9 @@ class WeightedOccurrenceArray extends Ar
   public WeightedOccurrence[] getWeightedOccurrences() {
     return (WeightedOccurrence[]) toArray();
   }
+  
+  @Override
+  public String toString() {
+    return Arrays.toString(getWeightedOccurrences());
+  }
 }



Mime
View raw message