public static double H(int C[][],int j,int k,int Ncount){
  double N=(double)Ncount;
  double N_j=Math.max(C[j][j],0.0001);
  double N_k=Math.max(C[k][k],0.0001);
  double N_jk=Math.max(C[j][k],0.0001);
  double p_1=(N + N_jk - (N_j + N_k));
  double p_2=(N_k - N_jk);
  double p_3=(N_j - N_jk);
  double p_5=(N - N_j);
  return -1.0 / N * (p_1 * Math.log(p_1) + p_2 * Math.log(p_2) + p_3 * Math.log(p_3) + N_jk * Math.log(N_jk) - p_5 * Math.log(p_5) - N_j * Math.log(N_j));
}

public static double H ( int C [ ] [ ] , int j , int k , int Ncount ) { double N = ( double ) Ncount ; double N_j = Math . max ( C [ j ] [ j ] , 0.0001 ) ; double N_k = Math . max ( C [ k ] [ k ] , 0.0001 ) ; double N_jk = Math . max ( C [ j ] [ k ] , 0.0001 ) ; double p_1 = ( N + N_jk - ( N_j + N_k ) ) ; double p_2 = ( N_k - N_jk ) ; double p_3 = ( N_j - N_jk ) ; double p_5 = ( N - N_j ) ; return - 1.0 / N * ( p_1 * Math . log ( p_1 ) + p_2 * Math . log ( p_2 ) + p_3 * Math . log ( p_3 ) + N_jk * Math . log ( N_jk ) - p_5 * Math . log ( p_5 ) - N_j * Math . log ( N_j ) ) ; }
h - conditional entropy h ( y_j | y_k ) . multi - label only
