@Override public void enterTreeModel(TreeModel treeModel){ TreeModel.NoTrueChildStrategy noTrueChildStrategy = treeModel.getNoTrueChildStrategy(); TreeModel.SplitCharacteristic splitCharacteristic = treeModel.getSplitCharacteristic(); if(!(TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION).equals(noTrueChildStrategy) || !(TreeModel.SplitCharacteristic.BINARY_SPLIT).equals(splitCharacteristic)){ throw new IllegalArgumentException(); } }
@Override public void enterTreeModel(TreeModel treeModel){ TreeModel.MissingValueStrategy missingValueStrategy = treeModel.getMissingValueStrategy(); TreeModel.NoTrueChildStrategy noTrueChildStrategy = treeModel.getNoTrueChildStrategy(); TreeModel.SplitCharacteristic splitCharacteristic = treeModel.getSplitCharacteristic(); if(!(TreeModel.MissingValueStrategy.NONE).equals(missingValueStrategy) || !(TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION).equals(noTrueChildStrategy) || !(TreeModel.SplitCharacteristic.BINARY_SPLIT).equals(splitCharacteristic)){ throw new IllegalArgumentException(); } this.miningFunction = treeModel.getMiningFunction(); this.replacedPredicates.clear(); }
@Override public void enterTreeModel(TreeModel treeModel){ TreeModel.MissingValueStrategy missingValueStrategy = treeModel.getMissingValueStrategy(); TreeModel.NoTrueChildStrategy noTrueChildStrategy = treeModel.getNoTrueChildStrategy(); TreeModel.SplitCharacteristic splitCharacteristic = treeModel.getSplitCharacteristic(); if(!(TreeModel.MissingValueStrategy.DEFAULT_CHILD).equals(missingValueStrategy) || !(TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION).equals(noTrueChildStrategy) || !(TreeModel.SplitCharacteristic.BINARY_SPLIT).equals(splitCharacteristic)){ throw new IllegalArgumentException(); } }
@Override public void enterTreeModel(TreeModel treeModel){ TreeModel.MissingValueStrategy missingValueStrategy = treeModel.getMissingValueStrategy(); TreeModel.NoTrueChildStrategy noTrueChildStrategy = treeModel.getNoTrueChildStrategy(); TreeModel.SplitCharacteristic splitCharacteristic = treeModel.getSplitCharacteristic(); if(!(TreeModel.MissingValueStrategy.DEFAULT_CHILD).equals(missingValueStrategy) || !(TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION).equals(noTrueChildStrategy) || !(TreeModel.SplitCharacteristic.BINARY_SPLIT).equals(splitCharacteristic)){ throw new IllegalArgumentException(); } }
@Override public void enterTreeModel(TreeModel treeModel){ TreeModel.MissingValueStrategy missingValueStrategy = treeModel.getMissingValueStrategy(); TreeModel.NoTrueChildStrategy noTrueChildStrategy = treeModel.getNoTrueChildStrategy(); TreeModel.SplitCharacteristic splitCharacteristic = treeModel.getSplitCharacteristic(); if(!(TreeModel.MissingValueStrategy.DEFAULT_CHILD).equals(missingValueStrategy) || !(TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION).equals(noTrueChildStrategy) || !(TreeModel.SplitCharacteristic.BINARY_SPLIT).equals(splitCharacteristic)){ throw new IllegalArgumentException(); } }
@Override public void enterTreeModel(TreeModel treeModel){ TreeModel.MissingValueStrategy missingValueStrategy = treeModel.getMissingValueStrategy(); TreeModel.NoTrueChildStrategy noTrueChildStrategy = treeModel.getNoTrueChildStrategy(); TreeModel.SplitCharacteristic splitCharacteristic = treeModel.getSplitCharacteristic(); if(!(TreeModel.MissingValueStrategy.NONE).equals(missingValueStrategy) || !(TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION).equals(noTrueChildStrategy) || !(TreeModel.SplitCharacteristic.BINARY_SPLIT).equals(splitCharacteristic)){ throw new IllegalArgumentException(); } this.miningFunction = treeModel.getMiningFunction(); }
private Trail handleNoTrueChild(Trail trail){ TreeModel treeModel = getModel(); TreeModel.NoTrueChildStrategy noTrueChildStrategy = treeModel.getNoTrueChildStrategy(); switch(noTrueChildStrategy){ case RETURN_NULL_PREDICTION: return trail.selectNull(); case RETURN_LAST_PREDICTION: Node lastPrediction = trail.getLastPrediction(); // "Return the parent Node only if it specifies a score attribute" if(lastPrediction.hasScore()){ return trail.selectLastPrediction(); } return trail.selectNull(); default: throw new UnsupportedAttributeException(treeModel, noTrueChildStrategy); } }