public DecisionTreeTrainer newClassifierTrainer (Classifier initialClassifier) { DecisionTreeTrainer t = new DecisionTreeTrainer (); t.maxDepth = this.maxDepth; t.minInfoGainSplit = this.minInfoGainSplit; return t; } }
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 DecisionTreeTrainer newClassifierTrainer (Classifier initialClassifier) { DecisionTreeTrainer t = new DecisionTreeTrainer (); t.maxDepth = this.maxDepth; t.minInfoGainSplit = this.minInfoGainSplit; return t; } }
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 DecisionTreeTrainer newClassifierTrainer (Classifier initialClassifier) { DecisionTreeTrainer t = new DecisionTreeTrainer (); t.maxDepth = this.maxDepth; t.minInfoGainSplit = this.minInfoGainSplit; return t; } }
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; }
break; case AdaBoost: this.trainer = new AdaBoostTrainer(new DecisionTreeTrainer()); this.classifier = null; break; case AdaBoostM2: this.trainer = new AdaBoostM2Trainer(new DecisionTreeTrainer()); this.classifier = null; break; this.trainer = new DecisionTreeTrainer(); this.classifier = null; break;
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; }