java.lang.ArrayIndexOutOfBoundsException: 6

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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
    via by Jaroslaw Nowosad,
    • java.lang.ArrayIndexOutOfBoundsException: 6 at water.MRTask.getResult(MRTask.java:477) at water.MRTask.getResult(MRTask.java:485) at water.MRTask.doAll(MRTask.java:389) at water.MRTask.doAll(MRTask.java:395) at hex.Model.predictScoreImpl(Model.java:886) at hex.Model.score(Model.java:813) at hex.Model.score(Model.java:806) at hex.Model.score(Model.java:789) at hex.naivebayes.NaiveBayes$NaiveBayesDriver.computeStatsFillModel(NaiveBayes.java:164) at hex.naivebayes.NaiveBayes$NaiveBayesDriver.compute2(NaiveBayes.java:190) at water.H2O$H2OCountedCompleter.compute(H2O.java:1194) at jsr166y.CountedCompleter.exec(CountedCompleter.java:468) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) Caused by: java.lang.ArrayIndexOutOfBoundsException: 6 at hex.genmodel.GenModel.getPrediction(GenModel.java:208) at hex.ModelMetricsMultinomial.updateHits(ModelMetricsMultinomial.java:64) at hex.ModelMetricsMultinomial$MetricBuilderMultinomial.perRow(ModelMetricsMultinomial.java:131) at hex.Model$BigScore.map(Model.java:960) at water.MRTask.compute2(MRTask.java:645) at water.H2O$H2OCountedCompleter.compute1(H2O.java:1197) at hex.Model$BigScore$Icer.compute1(Model$BigScore$Icer.java) at water.H2O$H2OCountedCompleter.compute(H2O.java:1193) ... 5 more
    No Bugmate found.