Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-9239

[ML] KMeansTrainer crashed if amount of possible clusters more than amount of partitions in dataset

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.7
    • ml
    • None
    • Docs Required

    Description

      How to reproduce?

      Set the K parameter in KMeans Trainer to 100, and run KMeansClusterization Example

      \

      StackTrace is

      Exception in thread "KMeansClusterizationExample-#44" java.lang.RuntimeException: java.lang.IllegalArgumentException: bound must be positive
      at org.apache.ignite.ml.clustering.kmeans.KMeansTrainer.fit(KMeansTrainer.java:112)
      at org.apache.ignite.ml.clustering.kmeans.KMeansTrainer.fit(KMeansTrainer.java:46)
      at org.apache.ignite.ml.trainers.DatasetTrainer.fit(DatasetTrainer.java:68)
      at org.apache.ignite.examples.ml.clustering.KMeansClusterizationExample.lambda$main$0(KMeansClusterizationExample.java:60)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.IllegalArgumentException: bound must be positive
      at java.util.Random.nextInt(Random.java:388)
      at org.apache.ignite.ml.clustering.kmeans.KMeansTrainer.initClusterCentersRandomly(KMeansTrainer.java:193)
      at org.apache.ignite.ml.clustering.kmeans.KMeansTrainer.fit(KMeansTrainer.java:86)
      ... 4 more

       

       

      The possible solution :

      correct the mechanism of rndPnts computation in the row 180-190 in KMeansTrainer

      Attachments

        Issue Links

          Activity

            People

              zaleslaw Alexey Zinoviev
              zaleslaw Alexey Zinoviev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: