public DataPair split(int feat){
        HashSet<Integer> index = new HashSet<Integer>();
        int[] examples = data.get(new Integer(feat));
        if (examples == null)
            return null;

        for (int i=0; i < examples.length; i++){
            index.add( examples[i] );
        }

        TreeMap<Integer, Integer> leftLabels = new TreeMap<Integer,Integer>();
        TreeMap<Integer, Integer> rightLabels = new TreeMap<Integer,Integer>();
        for (Map.Entry<Integer,Integer> entry : labels.entrySet()){
            if (index.contains( entry.getKey() )){
                leftLabels.put( entry.getKey(), entry.getValue());
            }else{
                rightLabels.put( entry.getKey(), entry.getValue());
            }
        }

        TreeMap<Integer, int[]> leftMap  = new TreeMap<Integer, int[]>();
        TreeMap<Integer, int[]> rightMap = new TreeMap<Integer, int[]>();
        for (Map.Entry<Integer, int[]> entry : data.entrySet()){
            ArrayList<Integer> leftList = new ArrayList<Integer>();
            ArrayList<Integer> rightList = new ArrayList<Integer>();

            examples = entry.getValue();
            for (int j=0; j < examples.length; j++){
                if (index.contains(examples[j])){
                    leftList.add(examples[j]);
                }else{
                    rightList.add(examples[j]);
                }
            }
            if (leftList.size() > 0)
                leftMap.put(entry.getKey(), toIntArray(leftList));
            if (rightList.size() > 0)
                rightMap.put(entry.getKey(), toIntArray(rightList));
        }
        Data leftData = new Data(leftLabels, leftMap);
        Data rightData = new Data(rightLabels, rightMap);
//        System.out.printf("split = %d(%d) | %d(%d)\n" , leftData.getNumExamples(), leftData.getMajority(), rightData.getNumExamples(), rightData.getMajority());
        return new DataPair(leftData, rightData);
    }