public double gainratio(int index, double enp) {
        // 100 is considered as max ClassLabels
        int c[][] = new int[1000][100];
        int sum[] = new int[1000]; //
        String currentatrrval = "@3#441get";
        double gainratio = 0;
        int j = 0;
        int m = -1; // index for split number
        int lines = linenumber;
        int totalsum = 0;
        for (int i = 0; i < lines; i++) {
            if (Integer.parseInt(count[i][0]) == index) {
                if (count[i][1].contentEquals(currentatrrval)) {
                    j++;
                    c[m][j] = Integer.parseInt(count[i][3]);
                    sum[m] = sum[m] + c[m][j];
                } else {
                    j = 0;
                    m++;
                    currentatrrval = count[i][1];
                    c[m][j] = Integer.parseInt(count[i][3]); // (different
                                                             // class) data sets
                                                             // count per m
                                                             // index split
                    sum[m] = c[m][j];
                }
            }
        }
        int p = 0;
        while (sum[p] != 0) {
            totalsum = totalsum + sum[p]; // calculating total instance in node
            p++;
        }
        double wtenp = 0;
        double splitenp = 0;
        double part = 0;
        for (int splitnum = 0; splitnum <= m; splitnum++) {
            part = (double) sum[splitnum] / totalsum;
            wtenp = wtenp + part * entropy(c[splitnum]);
        }
        splitenp = entropy(sum);
        gainratio = (enp - wtenp) / (splitenp);
        return gainratio;
    }