protected void splitTree (DecisionTree.Node node, FeatureSelection selectedFeatures, int depth) { if (depth == maxDepth || node.getSplitInfoGain() < minInfoGainSplit) return; logger.info("Splitting feature \""+node.getSplitFeature() +"\" infogain="+node.getSplitInfoGain()); node.split(selectedFeatures); splitTree (node.getFeaturePresentChild(), selectedFeatures, depth+1); splitTree (node.getFeatureAbsentChild(), selectedFeatures, depth+1); }
protected void splitTree (DecisionTree.Node node, FeatureSelection selectedFeatures, int depth) { if (depth == maxDepth || node.getSplitInfoGain() < minInfoGainSplit) return; logger.info("Splitting feature \""+node.getSplitFeature() +"\" infogain="+node.getSplitInfoGain()); node.split(selectedFeatures); splitTree (node.getFeaturePresentChild(), selectedFeatures, depth+1); splitTree (node.getFeatureAbsentChild(), selectedFeatures, depth+1); }
protected void splitTree (DecisionTree.Node node, FeatureSelection selectedFeatures, int depth) { if (depth == maxDepth || node.getSplitInfoGain() < minInfoGainSplit) return; logger.info("Splitting feature \""+node.getSplitFeature() +"\" infogain="+node.getSplitInfoGain()); node.split(selectedFeatures); splitTree (node.getFeaturePresentChild(), selectedFeatures, depth+1); splitTree (node.getFeatureAbsentChild(), selectedFeatures, depth+1); }
public DecisionTree train (InstanceList trainingList) { FeatureSelection selectedFeatures = trainingList.getFeatureSelection(); DecisionTree.Node root = new DecisionTree.Node (trainingList, null, selectedFeatures); splitTree (root, selectedFeatures, 0); root.stopGrowth(); finished = true; System.out.println ("DecisionTree learned:"); root.print(); this.classifier = new DecisionTree (trainingList.getPipe(), root); return classifier; }
public DecisionTree train (InstanceList trainingList) { FeatureSelection selectedFeatures = trainingList.getFeatureSelection(); DecisionTree.Node root = new DecisionTree.Node (trainingList, null, selectedFeatures); splitTree (root, selectedFeatures, 0); root.stopGrowth(); finished = true; System.out.println ("DecisionTree learned:"); root.print(); this.classifier = new DecisionTree (trainingList.getPipe(), root); return classifier; }
public DecisionTree train (InstanceList trainingList) { FeatureSelection selectedFeatures = trainingList.getFeatureSelection(); DecisionTree.Node root = new DecisionTree.Node (trainingList, null, selectedFeatures); splitTree (root, selectedFeatures, 0); root.stopGrowth(); finished = true; System.out.println ("DecisionTree learned:"); root.print(); this.classifier = new DecisionTree (trainingList.getPipe(), root); return classifier; }