public Node initRoot(List<Record> data) { Node root = DecisionTree.INSTANCE.getRoot(); SampleDistribute sampleDis = root.getSampleDistribute(); for (Record record : data) { sampleDis.acceptOneRecord(record); } root.calculteEntropy(); root.setPotentialClassifierAttrs(new HashSet<>(Data.INSTANCE.getDeterminingAttributes())); return root; }
public DecisionTree createDecisionTree(String fullFilePath) { List<Record> data = Data.INSTANCE.loadData(fullFilePath); return createDecisionTree(data); }