Mahout
  1. Mahout
  2. MAHOUT-721

Override org.apache.mahout.math.VectorWritable#toString()

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.6
    • Component/s: Math
    • Labels:
      None

      Description

      VectorWritable#toString method is currently default implementation.
      It should be implemented appropriately.

      For instance, after running RecommenderJob, I inspect the temporary files on HDFS.

      $ hadoop fs -libjars /path/to/mahout-core-0.5-job.jar -text temp/userVectors/part-r-00000

      But this command returns

      2       org.apache.mahout.math.VectorWritable@15f48262
      4       org.apache.mahout.math.VectorWritable@15f48262
      

      If the toString is not default implementation, we can see this result.

      2       {101:2.0,104:2.0,103:5.0,102:2.5}
      4       {101:5.0,106:4.0,104:4.5,103:3.0}
      
      1. Writable-toString.patch
        5 kB
        Daisuke Miyamoto
      2. VectorWritable.java.patch
        0.5 kB
        Daisuke Miyamoto

        Activity

        Hide
        Sean Owen added a comment -

        Great, done.

        Show
        Sean Owen added a comment - Great, done.
        Hide
        Daisuke Miyamoto added a comment -

        After posting this issue, I also found other classes to implement toString method.

        Show
        Daisuke Miyamoto added a comment - After posting this issue, I also found other classes to implement toString method.
        Hide
        Sean Owen added a comment -

        OK though I'd prefer not to incur the overhead of commons lang here... just make up some simple reasonable toString() representations.

        Show
        Sean Owen added a comment - OK though I'd prefer not to incur the overhead of commons lang here... just make up some simple reasonable toString() representations.
        Hide
        Daisuke Miyamoto added a comment -

        Thanks. I think so.

        Show
        Daisuke Miyamoto added a comment - Thanks. I think so.
        Hide
        Hudson added a comment -

        Integrated in Mahout-Quality #855 (See https://builds.apache.org/hudson/job/Mahout-Quality/855/)
        MAHOUT-721 just make VectorWritable implement toString()

        srowen : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1131342
        Files :

        • /mahout/trunk/core/src/main/java/org/apache/mahout/math/VectorWritable.java
        Show
        Hudson added a comment - Integrated in Mahout-Quality #855 (See https://builds.apache.org/hudson/job/Mahout-Quality/855/ ) MAHOUT-721 just make VectorWritable implement toString() srowen : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1131342 Files : /mahout/trunk/core/src/main/java/org/apache/mahout/math/VectorWritable.java
        Hide
        Hudson added a comment -

        Integrated in Mahout-Quality #856 (See https://builds.apache.org/hudson/job/Mahout-Quality/856/)
        MAHOUT-721 more toString() for writables

        srowen : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1131346
        Files :

        • /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/WeightedOccurrenceArray.java
        • /mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java
        • /mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrence.java
        Show
        Hudson added a comment - Integrated in Mahout-Quality #856 (See https://builds.apache.org/hudson/job/Mahout-Quality/856/ ) MAHOUT-721 more toString() for writables srowen : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1131346 Files : /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/WeightedOccurrenceArray.java /mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java /mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrence.java

          People

          • Assignee:
            Sean Owen
            Reporter:
            Daisuke Miyamoto
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development