public void id3(Node node) {
        Map<String, Integer> record = data.get(0);
        String maxAttribute = "";
        double maxInfoGain = 0;
        int zeros = zeroCount();
        int ones = size() - zeros;
        if (record.keySet().size() == 1 || ones == 0 || zeros == 0) {
            node.setValue(ones > zeros ? 1 : 0);
        } else {
            for (String attribute : record.keySet()) {
                if (!attribute.equals(classAttribute)) {
                    double infoGain = this.infoGain(attribute);
                    if (infoGain > maxInfoGain) {
                        maxAttribute = attribute;
                        maxInfoGain = infoGain;
                    }
                }
            }
            if (maxInfoGain == 0.0) {
                node.setValue(ones > zeros ? 1 : 0);
            } else {
                Data[] datas = split(maxAttribute);
                node.setAttribute(maxAttribute);
                node.setLeftChild(new Node());
                node.setRightChild(new Node());
                datas[0].id3(node.getLeftChild());
                datas[1].id3(node.getRightChild());
            }
        }

    }