double pa = accuracy;double pe = 0.0d;for (int i = 0; i < counter.length; i++) { double row = 0.0d; double column = 0.0d; for (int j = 0; j < counter[i].length; j++) { row += counter[i][j]; column += counter[j][i]; }// pe += ((row * column) / Math.pow(total, counter.length)); pe += row * column / (total * total);}return (pa - pe) / (1.0d - pe);