Mahout
  1. Mahout
  2. MAHOUT-360

the pref score field of output of org.apache.mahout.cf.taste.hadoop.item.RecommenderJob has been truncated

    Details

      Description

      the pref score field of output of org.apache.mahout.cf.taste.hadoop.item.RecommenderJob has been truncated if the pref score exceed six byte.

      in RecommendedItemsWritable.class

      @Override
      public String toString() {
      StringBuilder result = new StringBuilder(200);
      result.append('[');
      boolean first = true;
      for (RecommendedItem item : recommended) {
      if (first)

      { first = false; }

      else

      { result.append(','); }

      result.append(item.getItemID());
      result.append(':');
      String valueString = String.valueOf(item.getValue());
      // Is this rounding too crude?
      if (valueString.indexOf('E') >= 0)

      { valueString = "0.0"; }

      else if (valueString.length() > 6)

      { valueString = valueString.substring(0, 6); //here may cause problem,we can reserve all the bytes ,or just one byte decimal fraction }

      result.append(valueString);
      }
      result.append(']');
      return result.toString();
      }

      1. screenshot-1.jpg
        385 kB
        Han Hui Wen

        Activity

          People

          • Assignee:
            Sean Owen
            Reporter:
            Han Hui Wen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development