boolean defaultDecision = positiveRightChild.getId().equals(root.getDefaultChild());
private Trail handleDefaultChild(Trail trail, Node node, EvaluationContext context){ // "The defaultChild missing value strategy requires the presence of the defaultChild attribute in every non-leaf Node" String defaultChild = node.getDefaultChild(); if(defaultChild == null){ throw new MissingAttributeException(node, PMMLAttributes.NODE_DEFAULTCHILD); } trail.addMissingLevel(); List<Node> children = node.getNodes(); for(int i = 0, max = children.size(); i < max; i++){ Node child = children.get(i); String id = child.getId(); if(id != null && (id).equals(defaultChild)){ // The predicate of the referenced Node is not evaluated return handleTrue(trail, child, context); } } // "Only Nodes which are immediate children of the respective Node can be referenced" throw new InvalidAttributeException(node, PMMLAttributes.NODE_DEFAULTCHILD, defaultChild); }
String id = node.getId(); Object score = node.getScore(); String defaultChild = node.getDefaultChild();
String id = node.getId(); Object score = node.getScore(); String defaultChild = node.getDefaultChild();
String id = node.getId(); Object score = node.getScore(); String defaultChild = node.getDefaultChild();
boolean defaultDecision = positiveRightChild.getId().equals(root.getDefaultChild());
static public ComplexNode toComplexNode(Node node){ ComplexNode result = new ComplexNode() .setId(node.getId()) .setScore(node.getScore()) .setRecordCount(node.getRecordCount()) .setDefaultChild(node.getDefaultChild()) .setPredicate(node.getPredicate()); if(node.hasNodes()){ (result.getNodes()).addAll(node.getNodes()); } // End if if(node.hasScoreDistributions()){ (result.getScoreDistributions()).addAll(node.getScoreDistributions()); } return result; } }
value.setScore(node.getScore()); value.setRecordCount(node.getRecordCount()); value.setDefaultChild(node.getDefaultChild());
value.setScore(node.getScore()); value.setRecordCount(node.getRecordCount()); value.setDefaultChild(node.getDefaultChild());