java.lang.ArrayIndexOutOfBoundsException: 6

JIRA | Jaroslaw Nowosad | 10 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Im doing naivebayes model ( test using flow) on small data set - if needed can attache all stuff. Every time I got error: DistributedException from localhost/127.0.0.1:54321, caused by java.lang.ArrayIndexOutOfBoundsException: 6 on server side I got : Caused by: java.lang.ArrayIndexOutOfBoundsException: 6 ERRR: at hex.genmodel.GenModel.getPrediction(GenModel.java:208) ERRR: at hex.ModelMetricsMultinomial.updateHits(ModelMetricsMultinomial.java:64) I checked code and it looks like in the method getPrediction, is expecting that priorClassDist has the same number of arguments as ties for (Integer i : ties) { //ties = [0, 2] sum += priorClassDist[i]; //0.7 + 0.2 <<<<--- } // that's where I finish at the moment, I didn't dig much more - just suspecting that cause is somewhere else Full stack trace: 07-06 20:16:11.671 127.0.0.1:54321 20701 FJ-1-7 INFO: Confusion Matrix (vertical: actual; across: predicted): 07-06 20:16:11.671 127.0.0.1:54321 20701 FJ-1-7 INFO: 1 2 3 4 8 9 Error Rate 07-06 20:16:11.671 127.0.0.1:54321 20701 FJ-1-7 INFO: 1 0 67 0 23 0 0 1.0000 = 90 / 90 07-06 20:16:11.671 127.0.0.1:54321 20701 FJ-1-7 INFO: 2 0 1111 0 131 6 0 0.1098 = 137 / 1,248 07-06 20:16:11.671 127.0.0.1:54321 20701 FJ-1-7 INFO: 3 0 380 0 29 0 0 1.0000 = 409 / 409 07-06 20:16:11.671 127.0.0.1:54321 20701 FJ-1-7 INFO: 4 0 496 0 227 11 0 0.6907 = 507 / 734 07-06 20:16:11.671 127.0.0.1:54321 20701 FJ-1-7 INFO: 8 0 136 0 30 6 0 0.9651 = 166 / 172 07-06 20:16:11.671 127.0.0.1:54321 20701 FJ-1-7 INFO: 9 0 17 0 0 0 0 1.0000 = 17 / 17 07-06 20:16:11.671 127.0.0.1:54321 20701 FJ-1-7 INFO: Totals 0 2207 0 440 23 0 0.4966 = 1,326 / 2,670 07-06 20:16:11.672 127.0.0.1:54321 20701 FJ-1-7 INFO: Top-6 Hit Ratios: 07-06 20:16:11.672 127.0.0.1:54321 20701 FJ-1-7 INFO: K Hit Ratio 07-06 20:16:11.672 127.0.0.1:54321 20701 FJ-1-7 INFO: 1 0.503371 07-06 20:16:11.672 127.0.0.1:54321 20701 FJ-1-7 INFO: 2 0.753933 07-06 20:16:11.672 127.0.0.1:54321 20701 FJ-1-7 INFO: 3 0.950936 07-06 20:16:11.672 127.0.0.1:54321 20701 FJ-1-7 INFO: 4 0.989888 07-06 20:16:11.672 127.0.0.1:54321 20701 FJ-1-7 INFO: 5 1.000000 07-06 20:16:11.672 127.0.0.1:54321 20701 FJ-1-7 INFO: 6 1.000000 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: DistributedException from localhost/127.0.0.1:54321, caused by java.lang.ArrayIndexOutOfBoundsException: 6 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at water.MRTask.getResult(MRTask.java:477) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at water.MRTask.getResult(MRTask.java:485) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at water.MRTask.doAll(MRTask.java:389) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at water.MRTask.doAll(MRTask.java:395) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.Model.predictScoreImpl(Model.java:886) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.Model.score(Model.java:813) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.Model.score(Model.java:806) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.Model.score(Model.java:789) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.naivebayes.NaiveBayes$NaiveBayesDriver.computeStatsFillModel(NaiveBayes.java:164) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.naivebayes.NaiveBayes$NaiveBayesDriver.compute2(NaiveBayes.java:190) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at water.H2O$H2OCountedCompleter.compute(H2O.java:1194) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at jsr166y.CountedCompleter.exec(CountedCompleter.java:468) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: Caused by: java.lang.ArrayIndexOutOfBoundsException: 6 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.genmodel.GenModel.getPrediction(GenModel.java:208) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.ModelMetricsMultinomial.updateHits(ModelMetricsMultinomial.java:64) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.ModelMetricsMultinomial$MetricBuilderMultinomial.perRow(ModelMetricsMultinomial.java:131) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.Model$BigScore.map(Model.java:960) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at water.MRTask.compute2(MRTask.java:645) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at water.H2O$H2OCountedCompleter.compute1(H2O.java:1197) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at hex.Model$BigScore$Icer.compute1(Model$BigScore$Icer.java) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: at water.H2O$H2OCountedCompleter.compute(H2O.java:1193) 07-06 20:16:11.698 127.0.0.1:54321 20701 FJ-1-7 ERRR: ... 5 more

    JIRA | 10 months ago | Jaroslaw Nowosad
    java.lang.ArrayIndexOutOfBoundsException: 6

    Root Cause Analysis

    1. java.lang.ArrayIndexOutOfBoundsException

      6

      at hex.genmodel.GenModel.getPrediction()
    2. hex.genmodel
      GenModel.getPrediction
      1. hex.genmodel.GenModel.getPrediction(GenModel.java:208)
      1 frame
    3. hex
      Model$BigScore.map
      1. hex.ModelMetricsMultinomial.updateHits(ModelMetricsMultinomial.java:64)
      2. hex.ModelMetricsMultinomial$MetricBuilderMultinomial.perRow(ModelMetricsMultinomial.java:131)
      3. hex.Model$BigScore.map(Model.java:960)
      3 frames
    4. water
      H2O$H2OCountedCompleter.compute1
      1. water.MRTask.compute2(MRTask.java:645)
      2. water.H2O$H2OCountedCompleter.compute1(H2O.java:1197)
      2 frames
    5. hex
      Model$BigScore$Icer.compute1
      1. hex.Model$BigScore$Icer.compute1(Model$BigScore$Icer.java)
      1 frame
    6. water
      H2O$H2OCountedCompleter.compute
      1. water.H2O$H2OCountedCompleter.compute(H2O.java:1193)
      1 frame
    7. jsr166y
      ForkJoinWorkerThread.run
      1. jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
      2. jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
      3. jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
      4. jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
      5. jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
      5 frames