public double associationClassesAttribute(double[][] counts){

    List<Integer> supportSet = new ArrayList<Integer>();
    List<Integer> not_supportSet = new ArrayList<Integer>();

    double separability = 0;


    int numValues = counts.length;
    int numClasses = counts[0].length;

    int total = 0;

    double[] sumRows = new double[numValues];
    double[] sumCols = new double[numClasses];

    // get the row totals
    for (int i = 0; i < numValues; i++) {
      sumRows[i] = 0.0;

      for (int j = 0; j < numClasses; j++) {
        sumRows[i] += counts[i][j];
        total += counts[i][j];
      }
    }

    // get the column totals
    for (int j = 0; j < numClasses; j++) {
      sumCols[j] = 0.0;

      for (int i = 0; i < numValues; i++) {
        sumCols[j] += counts[i][j];
      }
    }

    for (int i = 0; i < numValues; i++) {
      for (int j = 0; j < numClasses; j++) {

        //Computing Conditional Probability P(Valuei | Clasej)
        double numerator1 = counts[i][j];
        double denominator1 = sumCols[j];
        double result1;

        if(denominator1 != 0)
          result1 = numerator1/denominator1;
        else
          result1 = 0;

        //Computing Conditional Probability P(Valuei | ^Clasej)
        double numerator2 = sumRows[i] - counts[i][j];
        double denominator2 = total - sumCols[j];
        double result2;

        if(denominator2 != 0)
          result2 = numerator2/denominator2;
        else
          result2 = 0;


        if(result1 > result2){
          supportSet.add (i);
          separability +=result1;
        }
        else{
          not_supportSet.add (i);
          separability +=result2;
        }
      }

    }

    return separability/numClasses - 1.0;
  }