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

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

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

Node negativeLeftChild;
Node positiveRightChild;
if (child1.getPredicate() instanceof True) {
 negativeLeftChild = child1;
 positiveRightChild = child2;
} else {
 Preconditions.checkArgument(child2.getPredicate() instanceof True);
 negativeLeftChild = child2;
 positiveRightChild = child1;
Predicate predicate = positiveRightChild.getPredicate();
boolean defaultDecision = positiveRightChild.getId().equals(root.getDefaultChild());

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

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

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

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

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

@Override
public void exitNode(Node node){
  Predicate predicate = node.getPredicate();
  if(predicate instanceof True){
    Node parentNode = getParentNode();
    if(parentNode == null){
      return;
    }
    initScore(parentNode, node);
    replaceChildWithGrandchildren(parentNode, node);
  }
}

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

@Override
public void exitNode(Node node){
  Predicate predicate = node.getPredicate();
  if(predicate instanceof True){
    Node parentNode = getParentNode();
    if(parentNode == null){
      return;
    }
    initScore(parentNode, node);
    replaceChildWithGrandchildren(parentNode, node);
  }
}

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

private boolean isDefinedField(HasFieldReference<?> hasFieldReference){
    FieldName name = hasFieldReference.getField();

    Node ancestorNode = getAncestorNode(node -> hasFieldReference(node.getPredicate(), name));

    return (ancestorNode != null);
  }
}

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

@Override
public void exitNode(Node node){
  Predicate predicate = node.getPredicate();
  if(predicate instanceof True){
    Node parentNode = getParentNode();
    if(parentNode == null){
      return;
    }
    initScore(parentNode, node);
    replaceChildWithGrandchildren(parentNode, node);
  }
}

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

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

代码示例来源: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;
    }
    List<Node> parentChildren = parentNode.getNodes();
    if(parentChildren.size() != 1){
      return;
    }
    boolean success = parentChildren.remove(node);
    if(!success){
      throw new IllegalArgumentException();
    } // End if
    if((MiningFunction.REGRESSION).equals(this.miningFunction)){
      initScore(parentNode, node);
    } else
    if((MiningFunction.CLASSIFICATION).equals(this.miningFunction)){
      initScoreDistribution(parentNode, node);
    } else
    {
      throw new IllegalArgumentException();
    }
  }
}

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

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

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

private void makeDefault(Node node){
  Predicate predicate = node.getPredicate();
  CompoundPredicate compoundPredicate;
  if(predicate instanceof CompoundPredicate){
    compoundPredicate = (CompoundPredicate)predicate;
  } else
  {
    compoundPredicate = new CompoundPredicate(CompoundPredicate.BooleanOperator.SURROGATE)
      .addPredicates(predicate);
    node.setPredicate(compoundPredicate);
  }
  compoundPredicate.addPredicates(new True());
}

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

@Override
public void exitNode(Node node){
  Double recordCount = node.getRecordCount();
  Predicate predicate = node.getPredicate();
  if(recordCount != null){
    node.setRecordCount(null);
  } // End if
  if(predicate instanceof True){
    Node parentNode = getParentNode();
    if(parentNode == null){
      return;
    }
    initScore(parentNode, node);
    replaceChildWithGrandchildren(parentNode, node);
  }
}

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

Node negativeLeftChild;
Node positiveRightChild;
if (child1.getPredicate() instanceof True) {
 negativeLeftChild = child1;
 positiveRightChild = child2;
} else {
 Preconditions.checkArgument(child2.getPredicate() instanceof True);
 negativeLeftChild = child2;
 positiveRightChild = child1;
Predicate predicate = positiveRightChild.getPredicate();
boolean defaultDecision = positiveRightChild.getId().equals(root.getDefaultChild());

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

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

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

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

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

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

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

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

相关文章