private double getInformationGain(double entropy, int featureIndex, DataSet dataset){
        int dataSize = dataset.getNumOfInstance();
        // get the mean
        double mean = 0;
        for (int i = 0; i < dataset.getNumOfInstance(); i++){
            double[] featureVector = dataset.getInstance(i).getFeatureVector();
            mean += featureVector[featureIndex]/dataSize;
        }
        
        // divide the dataset into two subset, based on the mean value. 
        int leftSize = 0;
        for (int i = 0; i < dataSize; i++){
            if ((dataset.getInstance(i).getFeatureVector())[featureIndex] < mean)
                leftSize++;
        }
        int rightSize = dataSize - leftSize;
        
        List<Integer> leftLabels = new ArrayList<Integer>(leftSize);
        List<Integer> rightLabels = new ArrayList<Integer>(rightSize);
        
        for (int i = 0; i < dataSize; i++){
            if (dataset.getInstance(i).getFeatureVector()[featureIndex] < mean)
                leftLabels.add(dataset.getInstance(i).getLabelIndex());
            else
                rightLabels.add(dataset.getInstance(i).getLabelIndex());
        }
        
        double leftEntropy = EntropyUtils.getEntropy(leftLabels);
        double rightEntropy = EntropyUtils.getEntropy(rightLabels);
        
        return entropy - (leftSize*1.0/dataSize) * leftEntropy 
                - (rightSize*1.0/dataSize) * rightEntropy;
    }