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

Multinomial<T> throws ConcurrentModificationException when iterating and setting probabilities

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.8
    • 0.8
    • None
    • None

    Description

      Here's [1] an example of the problem (from BallKMeans, lines 225-232, [2]).

      When iterating through the elements in a Multinomial and updating the probabilities, sometimes newWeight becomes 0 (because of using CosineDistances).
      When setting a weight to 0 in Multinomial, the element is removed from the items hash map while using the hash map for iteration.
      This causes a ConcurrentModificationException.

      [1] https://gist.github.com/dfilimon/5270234
      [2] https://github.com/dfilimon/mahout/blob/skm/core/src/main/java/org/apache/mahout/clustering/streaming/cluster/BallKMeans.java#L225

      Attachments

        1. MAHOUT_1180.patch
          15 kB
          Dan Filimon
        2. MAHOUT_1180.patch
          1 kB
          Dan Filimon

        Activity

          People

            Unassigned Unassigned
            dfilimon Dan Filimon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: