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

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

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

Node.hasNodes介绍

暂无

代码示例

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

  1. @Override
  2. public VisitorAction visit(Node node){
  3. if(node.hasNodes()){
  4. List<Node> nodes = node.getNodes();
  5. Collections.sort(nodes, NodeSorter.COMPARATOR);
  6. }
  7. return super.visit(node);
  8. }

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

  1. @Override
  2. public VisitorAction visit(Node node){
  3. if(node.hasNodes()){
  4. List<Node> nodes = node.getNodes();
  5. Collections.sort(nodes, NodeSorter.COMPARATOR);
  6. }
  7. return super.visit(node);
  8. }

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

  1. @Override
  2. public void enterNode(Node node){
  3. if(node.hasNodes()){
  4. List<Node> children = node.getNodes();
  5. children:
  6. while(true){
  7. ListIterator<Node> childIt = children.listIterator();
  8. grandChildren:
  9. while(childIt.hasNext()){
  10. Node child = childIt.next();
  11. Iterator<Node> grandChildIt = getChildren(child);
  12. if(grandChildIt == null){
  13. continue grandChildren;
  14. }
  15. childIt.remove();
  16. while(grandChildIt.hasNext()){
  17. Node grandChild = grandChildIt.next();
  18. grandChildIt.remove();
  19. childIt.add(grandChild);
  20. }
  21. childIt.add(child);
  22. continue children;
  23. }
  24. break;
  25. }
  26. }
  27. }

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

  1. @Override
  2. public VisitorAction visit(Node node){
  3. if(!node.hasNodes()){
  4. process(node);
  5. }
  6. return super.visit(node);
  7. }

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

  1. @Override
  2. public VisitorAction visit(Node node){
  3. if(!node.hasNodes()){
  4. process(node);
  5. }
  6. return super.visit(node);
  7. }

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

  1. private ImmutableBiMap.Builder<String, Node> collectNodes(Node node, AtomicInteger index, ImmutableBiMap.Builder<String, Node> builder){
  2. builder = EntityUtil.put(node, index, builder);
  3. if(!node.hasNodes()){
  4. return builder;
  5. }
  6. List<Node> children = node.getNodes();
  7. for(Node child : children){
  8. builder = collectNodes(child, index, builder);
  9. }
  10. return builder;
  11. }
  12. });

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

  1. if(node.hasNodes()){
  2. List<Node> children = node.getNodes();

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

  1. if(node.hasNodes()){
  2. List<Node> children = node.getNodes();

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

  1. if(node.hasNodes()){
  2. List<Node> children = node.getNodes();

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

  1. private Trail handleTrue(Trail trail, Node node, EvaluationContext context){
  2. // A "true" leaf node
  3. if(!node.hasNodes()){
  4. return trail.selectNode(node);
  5. }
  6. trail.push(node);
  7. List<Node> children = node.getNodes();
  8. for(int i = 0, max = children.size(); i < max; i++){
  9. Node child = children.get(i);
  10. Boolean status = evaluateNode(trail, child, context);
  11. if(status == null){
  12. Trail destination = handleMissingValue(trail, node, child, context);
  13. if(destination != null){
  14. return destination;
  15. }
  16. } else
  17. if(status.booleanValue()){
  18. return handleTrue(trail, child, context);
  19. }
  20. }
  21. // A "true" non-leaf node
  22. return handleNoTrueChild(trail);
  23. }

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

  1. if(node.hasNodes()){
  2. List<Node> children = node.getNodes();

代码示例来源: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-sklearn

  1. if(node.hasNodes()){
  2. List<Node> children = node.getNodes();

代码示例来源: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-r

  1. if(node.hasNodes()){
  2. List<Node> children = node.getNodes();

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

  1. if(node.hasNodes()){
  2. List<Node> children = node.getNodes();

代码示例来源: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: org.jpmml/pmml-model

  1. if(node.hasNodes()){
  2. (value.getNodes()).addAll(node.getNodes());

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

  1. if(node.hasNodes()){
  2. (value.getNodes()).addAll(node.getNodes());

相关文章