예제 #1
0
 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;
 }
예제 #2
0
  public DecisionTree createDecisionTree(String fullFilePath) {

    List<Record> data = Data.INSTANCE.loadData(fullFilePath);
    return createDecisionTree(data);
  }