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

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

本文整理了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

@Override
public VisitorAction visit(Node node){
  if(node.hasNodes()){
    List<Node> nodes = node.getNodes();
    Collections.sort(nodes, NodeSorter.COMPARATOR);
  }
  return super.visit(node);
}

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

@Override
public VisitorAction visit(Node node){
  if(node.hasNodes()){
    List<Node> nodes = node.getNodes();
    Collections.sort(nodes, NodeSorter.COMPARATOR);
  }
  return super.visit(node);
}

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

@Override
public void enterNode(Node node){
  if(node.hasNodes()){
    List<Node> children = node.getNodes();
    children:
    while(true){
      ListIterator<Node> childIt = children.listIterator();
      grandChildren:
      while(childIt.hasNext()){
        Node child = childIt.next();
        Iterator<Node> grandChildIt = getChildren(child);
        if(grandChildIt == null){
          continue grandChildren;
        }
        childIt.remove();
        while(grandChildIt.hasNext()){
          Node grandChild = grandChildIt.next();
          grandChildIt.remove();
          childIt.add(grandChild);
        }
        childIt.add(child);
        continue children;
      }
      break;
    }
  }
}

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

@Override
public VisitorAction visit(Node node){
  if(!node.hasNodes()){
    process(node);
  }
  return super.visit(node);
}

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

@Override
public VisitorAction visit(Node node){
  if(!node.hasNodes()){
    process(node);
  }
  return super.visit(node);
}

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

private ImmutableBiMap.Builder<String, Node> collectNodes(Node node, AtomicInteger index, ImmutableBiMap.Builder<String, Node> builder){
    builder = EntityUtil.put(node, index, builder);
    if(!node.hasNodes()){
      return builder;
    }
    List<Node> children = node.getNodes();
    for(Node child : children){
      builder = collectNodes(child, index, builder);
    }
    return builder;
  }
});

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

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

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

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

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

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

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

private Trail handleTrue(Trail trail, Node node, EvaluationContext context){
  // A "true" leaf node
  if(!node.hasNodes()){
    return trail.selectNode(node);
  }
  trail.push(node);
  List<Node> children = node.getNodes();
  for(int i = 0, max = children.size(); i < max; i++){
    Node child = children.get(i);
    Boolean status = evaluateNode(trail, child, context);
    if(status == null){
      Trail destination = handleMissingValue(trail, node, child, context);
      if(destination != null){
        return destination;
      }
    } else
    if(status.booleanValue()){
      return handleTrue(trail, child, context);
    }
  }
  // A "true" non-leaf node
  return handleNoTrueChild(trail);
}

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

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

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

@Override
public void exitNode(Node node){
  Predicate predicate = node.getPredicate();
  if(predicate instanceof True){
    Node parentNode = getParentNode();
    if(parentNode == null){
      return;
    }
    if((MiningFunction.REGRESSION).equals(this.miningFunction)){
      initScore(parentNode, node);
      replaceChildWithGrandchildren(parentNode, node);
    } else
    if((MiningFunction.CLASSIFICATION).equals(this.miningFunction)){
      // Replace intermediate nodes, but not terminal nodes
      if(node.hasNodes()){
        replaceChildWithGrandchildren(parentNode, node);
      }
    } else
    {
      throw new IllegalArgumentException();
    }
  }
}

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

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

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

@Override
public void exitNode(Node node){
  Predicate predicate = node.getPredicate();
  if(predicate instanceof True){
    Node parentNode = getParentNode();
    if(parentNode == null){
      return;
    }
    if((MiningFunction.REGRESSION).equals(this.miningFunction)){
      initScore(parentNode, node);
      replaceChildWithGrandchildren(parentNode, node);
    } else
    if((MiningFunction.CLASSIFICATION).equals(this.miningFunction)){
      // Replace intermediate nodes, but not terminal nodes
      if(node.hasNodes()){
        replaceChildWithGrandchildren(parentNode, node);
      }
    } else
    {
      throw new IllegalArgumentException();
    }
  }
}

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

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

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

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

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

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;
  }
}

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

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

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

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

相关文章