public double adjustedRandIndex(){
  double d=Math.sqrt(pairconfuse[0] + pairconfuse[1] + pairconfuse[2]+ pairconfuse[3]);
  double exp=(pairconfuse[0] + pairconfuse[1]) / d * (pairconfuse[0] + pairconfuse[2]) / d;
  double opt=pairconfuse[0] + 0.5 * (pairconfuse[1] + pairconfuse[2]);
  return (pairconfuse[0] - exp) / (opt - exp);
}

public double adjustedRandIndex ( ) { double d = Math . sqrt ( pairconfuse [ 0 ] + pairconfuse [ 1 ] + pairconfuse [ 2 ] + pairconfuse [ 3 ] ) ; double exp = ( pairconfuse [ 0 ] + pairconfuse [ 1 ] ) / d * ( pairconfuse [ 0 ] + pairconfuse [ 2 ] ) / d ; double opt = pairconfuse [ 0 ] + 0.5 * ( pairconfuse [ 1 ] + pairconfuse [ 2 ] ) ; return ( pairconfuse [ 0 ] - exp ) / ( opt - exp ) ; }
computes the adjusted rand index ( ari ) .
