Uploaded image for project: 'Mahout'
  1. Mahout
  2. MAHOUT-1739

maxSimilarItemsPerItem param of ItemSimilarityJob doesn't behave correct

    XMLWordPrintableJSON

Details

    Description

      the output similar items of ItemSimilarityJob for each target item may exceed the number of similar items we set to maxSimilarItemsPerItem parameter. the following code of ItemSimilarityJob.java about line NO. 200 may affect:
      if (itemID < otherItemID)

      { ctx.write(new EntityEntityWritable(itemID, otherItemID), new DoubleWritable(similarItem.getSimilarity())); }

      else

      { ctx.write(new EntityEntityWritable(otherItemID, itemID), new DoubleWritable(similarItem.getSimilarity())); }

      Don't know why need to switch itemID with otherItemID, but I think a single line is enough:
      ctx.write(new EntityEntityWritable(itemID, otherItemID), new DoubleWritable(similarItem.getSimilarity()));

      Attachments

        Activity

          People

            Unassigned Unassigned
            lariven lariven
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: