org.dmg.pmml.tree.Node.getPredicate()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.dmg.pmml.tree.Node.getPredicate()方法的一些代码示例,展示了Node.getPredicate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getPredicate()方法的具体详情如下:
包路径:org.dmg.pmml.tree.Node
类名称:Node
方法名:getPredicate

Node.getPredicate介绍

暂无

代码示例

代码示例来源:origin: OryxProject/oryx

  1. Node negativeLeftChild;
  2. Node positiveRightChild;
  3. if (child1.getPredicate() instanceof True) {
  4. negativeLeftChild = child1;
  5. positiveRightChild = child2;
  6. } else {
  7. Preconditions.checkArgument(child2.getPredicate() instanceof True);
  8. negativeLeftChild = child2;
  9. positiveRightChild = child1;
  10. Predicate predicate = positiveRightChild.getPredicate();
  11. boolean defaultDecision = positiveRightChild.getId().equals(root.getDefaultChild());

代码示例来源:origin: OryxProject/oryx

  1. Node rightChild = children.get(0);
  2. Node leftChild = children.get(1);
  3. assertInstanceOf(leftChild.getPredicate(), True.class);
  4. assertEquals(node.getRecordCount().doubleValue(),
  5. leftChild.getRecordCount() + rightChild.getRecordCount());

代码示例来源:origin: jpmml/jpmml-sparkml

  1. private void addCategoricalField(Node node){
  2. this.replacedPredicates.put(node, (SimpleSetPredicate)node.getPredicate());
  3. }
  4. }

代码示例来源:origin: jpmml/jpmml-xgboost

  1. @Override
  2. public void exitNode(Node node){
  3. Predicate predicate = node.getPredicate();
  4. if(predicate instanceof True){
  5. Node parentNode = getParentNode();
  6. if(parentNode == null){
  7. return;
  8. }
  9. initScore(parentNode, node);
  10. replaceChildWithGrandchildren(parentNode, node);
  11. }
  12. }

代码示例来源:origin: org.jpmml/jpmml-xgboost

  1. @Override
  2. public void exitNode(Node node){
  3. Predicate predicate = node.getPredicate();
  4. if(predicate instanceof True){
  5. Node parentNode = getParentNode();
  6. if(parentNode == null){
  7. return;
  8. }
  9. initScore(parentNode, node);
  10. replaceChildWithGrandchildren(parentNode, node);
  11. }
  12. }

代码示例来源:origin: jpmml/jpmml-r

  1. private boolean isDefinedField(HasFieldReference<?> hasFieldReference){
  2. FieldName name = hasFieldReference.getField();
  3. Node ancestorNode = getAncestorNode(node -> hasFieldReference(node.getPredicate(), name));
  4. return (ancestorNode != null);
  5. }
  6. }

代码示例来源:origin: jpmml/jpmml-r

  1. @Override
  2. public void exitNode(Node node){
  3. Predicate predicate = node.getPredicate();
  4. if(predicate instanceof True){
  5. Node parentNode = getParentNode();
  6. if(parentNode == null){
  7. return;
  8. }
  9. initScore(parentNode, node);
  10. replaceChildWithGrandchildren(parentNode, node);
  11. }
  12. }

代码示例来源:origin: jpmml/jpmml-sklearn

  1. static
  2. private Iterator<Node> getChildren(Node node){
  3. Predicate predicate = node.getPredicate();
  4. Predicate childPredicate = child.getPredicate();

代码示例来源:origin: jpmml/jpmml-sklearn

  1. @Override
  2. public void exitNode(Node node){
  3. Predicate predicate = node.getPredicate();
  4. if(predicate instanceof True){
  5. Node parentNode = getParentNode();
  6. if(parentNode == null){
  7. return;
  8. }
  9. List<Node> parentChildren = parentNode.getNodes();
  10. if(parentChildren.size() != 1){
  11. return;
  12. }
  13. boolean success = parentChildren.remove(node);
  14. if(!success){
  15. throw new IllegalArgumentException();
  16. } // End if
  17. if((MiningFunction.REGRESSION).equals(this.miningFunction)){
  18. initScore(parentNode, node);
  19. } else
  20. if((MiningFunction.CLASSIFICATION).equals(this.miningFunction)){
  21. initScoreDistribution(parentNode, node);
  22. } else
  23. {
  24. throw new IllegalArgumentException();
  25. }
  26. }
  27. }

代码示例来源:origin: jpmml/jpmml-sklearn

  1. Node secondChild = children.get(1);
  2. Predicate firstPredicate = firstChild.getPredicate();
  3. Predicate secondPredicate = secondChild.getPredicate();

代码示例来源:origin: jpmml/jpmml-r

  1. private void makeDefault(Node node){
  2. Predicate predicate = node.getPredicate();
  3. CompoundPredicate compoundPredicate;
  4. if(predicate instanceof CompoundPredicate){
  5. compoundPredicate = (CompoundPredicate)predicate;
  6. } else
  7. {
  8. compoundPredicate = new CompoundPredicate(CompoundPredicate.BooleanOperator.SURROGATE)
  9. .addPredicates(predicate);
  10. node.setPredicate(compoundPredicate);
  11. }
  12. compoundPredicate.addPredicates(new True());
  13. }

代码示例来源:origin: jpmml/jpmml-lightgbm

  1. @Override
  2. public void exitNode(Node node){
  3. Double recordCount = node.getRecordCount();
  4. Predicate predicate = node.getPredicate();
  5. if(recordCount != null){
  6. node.setRecordCount(null);
  7. } // End if
  8. if(predicate instanceof True){
  9. Node parentNode = getParentNode();
  10. if(parentNode == null){
  11. return;
  12. }
  13. initScore(parentNode, node);
  14. replaceChildWithGrandchildren(parentNode, node);
  15. }
  16. }

代码示例来源:origin: com.cloudera.oryx/oryx-app-common

  1. Node negativeLeftChild;
  2. Node positiveRightChild;
  3. if (child1.getPredicate() instanceof True) {
  4. negativeLeftChild = child1;
  5. positiveRightChild = child2;
  6. } else {
  7. Preconditions.checkArgument(child2.getPredicate() instanceof True);
  8. negativeLeftChild = child2;
  9. positiveRightChild = child1;
  10. Predicate predicate = positiveRightChild.getPredicate();
  11. boolean defaultDecision = positiveRightChild.getId().equals(root.getDefaultChild());

代码示例来源:origin: jpmml/jpmml-sparkml

  1. @Override
  2. public void exitNode(Node node){
  3. Predicate predicate = node.getPredicate();
  4. if(predicate instanceof True){
  5. Node parentNode = getParentNode();
  6. if(parentNode == null){
  7. return;
  8. }
  9. if((MiningFunction.REGRESSION).equals(this.miningFunction)){
  10. initScore(parentNode, node);
  11. replaceChildWithGrandchildren(parentNode, node);
  12. } else
  13. if((MiningFunction.CLASSIFICATION).equals(this.miningFunction)){
  14. // Replace intermediate nodes, but not terminal nodes
  15. if(node.hasNodes()){
  16. replaceChildWithGrandchildren(parentNode, node);
  17. }
  18. } else
  19. {
  20. throw new IllegalArgumentException();
  21. }
  22. }
  23. }

代码示例来源:origin: jpmml/jpmml-sklearn

  1. @Override
  2. public void exitNode(Node node){
  3. Predicate predicate = node.getPredicate();
  4. if(predicate instanceof True){
  5. Node parentNode = getParentNode();
  6. if(parentNode == null){
  7. return;
  8. }
  9. if((MiningFunction.REGRESSION).equals(this.miningFunction)){
  10. initScore(parentNode, node);
  11. replaceChildWithGrandchildren(parentNode, node);
  12. } else
  13. if((MiningFunction.CLASSIFICATION).equals(this.miningFunction)){
  14. // Replace intermediate nodes, but not terminal nodes
  15. if(node.hasNodes()){
  16. replaceChildWithGrandchildren(parentNode, node);
  17. }
  18. } else
  19. {
  20. throw new IllegalArgumentException();
  21. }
  22. }
  23. }

代码示例来源:origin: jpmml/jpmml-r

  1. Node secondChild = children.get(1);
  2. Predicate firstPredicate = firstChild.getPredicate();
  3. Predicate secondPredicate = secondChild.getPredicate();

代码示例来源:origin: jpmml/jpmml-sparkml

  1. Node secondChild = children.get(1);
  2. Predicate firstPredicate = firstChild.getPredicate();
  3. Predicate secondPredicate = secondChild.getPredicate();

代码示例来源:origin: jpmml/jpmml-r

  1. static
  2. public ComplexNode toComplexNode(Node node){
  3. ComplexNode result = new ComplexNode()
  4. .setId(node.getId())
  5. .setScore(node.getScore())
  6. .setRecordCount(node.getRecordCount())
  7. .setDefaultChild(node.getDefaultChild())
  8. .setPredicate(node.getPredicate());
  9. if(node.hasNodes()){
  10. (result.getNodes()).addAll(node.getNodes());
  11. } // End if
  12. if(node.hasScoreDistributions()){
  13. (result.getScoreDistributions()).addAll(node.getScoreDistributions());
  14. }
  15. return result;
  16. }
  17. }

代码示例来源:origin: jpmml/jpmml-model

  1. value.setPredicate(node.getPredicate());
  2. value.setPartition(node.getPartition());

代码示例来源:origin: org.jpmml/pmml-model

  1. value.setPredicate(node.getPredicate());
  2. value.setPartition(node.getPartition());

相关文章