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

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

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

Node.setPredicate介绍

暂无

代码示例

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

modelNode.setPredicate(predicate);

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

Node rootNode = new Node().setId("r").setRecordCount(dummyCount).setPredicate(new True());
  .setId("r-")
  .setRecordCount(halfCount)
  .setPredicate(new True())
  .setScore("-2.0");
Node right = new Node().setId("r+").setRecordCount(halfCount)
  .setPredicate(new SimplePredicate(FieldName.create("foo"),
                   SimplePredicate.Operator.GREATER_THAN).setValue("3.14"))
  .setScore("2.0");

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

Node rootNode = new Node().setId("r").setRecordCount(dummyCount).setPredicate(new True());
Node left = new Node().setId("r-").setRecordCount(halfCount).setPredicate(new True());
left.addScoreDistributions(new ScoreDistribution("apple", halfCount));
Node right = new Node().setId("r+").setRecordCount(halfCount)
  .setPredicate(new SimpleSetPredicate(FieldName.create("color"),
                     SimpleSetPredicate.BooleanOperator.IS_NOT_IN,
                     new Array(Array.Type.STRING, "red")));

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

secondChild.setPredicate(new True());
} else

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

secondChild.setPredicate(new True());
} else

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

secondChild.setPredicate(new True());
} else

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

secondChild.setPredicate(new True());
} else

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

secondChild.setPredicate(new True());

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

static
private <M extends Model<M> & DecisionTreeModel> TreeModel encodeTreeModel(M model, PredicateManager predicateManager, MiningFunction miningFunction, ScoreEncoder scoreEncoder, Schema schema){
  Node root = new Node()
    .setPredicate(new True());
  encodeNode(root, model.rootNode(), predicateManager, new CategoryManager(), scoreEncoder, schema);
  TreeModel treeModel = new TreeModel(miningFunction, ModelUtil.createMiningSchema(schema.getLabel()), root)
    .setSplitCharacteristic(TreeModel.SplitCharacteristic.BINARY_SPLIT);
  return treeModel;
}

代码示例来源:origin: cheng-li/pyramid

public TreeModel encodeTreeModel(Schema schema){
  org.dmg.pmml.tree.Node root = new org.dmg.pmml.tree.Node()
      .setPredicate(new True());
  encodeNode(root, 0, schema);
  TreeModel treeModel = new TreeModel(MiningFunction.REGRESSION, ModelUtil.createMiningSchema(schema.getLabel()), root)
      .setSplitCharacteristic(TreeModel.SplitCharacteristic.BINARY_SPLIT)
      .setMissingValueStrategy(TreeModel.MissingValueStrategy.NONE)
      .setMathContext(MathContext.FLOAT);
  return treeModel;
}

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

secondChild.setPredicate(new True());

代码示例来源:origin: cheng-li/pyramid

private void encodeNode(org.dmg.pmml.tree.Node parent, int index, Schema schema){
  parent.setId(String.valueOf(index + 1));
  Node node = allNodes.get(index);
  if(!node.isLeaf()){
    int splitIndex = node.getFeatureIndex();
    Feature feature = schema.getFeature(splitIndex);
    org.dmg.pmml.tree.Node leftChild = new org.dmg.pmml.tree.Node()
        .setPredicate(encodePredicate(feature, node, true));
    encodeNode(leftChild, node.getLeftChild().getId(), schema);
    org.dmg.pmml.tree.Node rightChild = new org.dmg.pmml.tree.Node()
        .setPredicate(encodePredicate(feature, node, false));
    encodeNode(rightChild, node.getRightChild().getId(), schema);
    parent.addNodes(leftChild, rightChild);
    boolean defaultLeft = false;
    parent.setDefaultChild(defaultLeft ? leftChild.getId() : rightChild.getId());
  } else
  {
    float value = (float)node.getValue();
    parent.setScore(ValueUtil.formatValue(value));
  }
}

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

.setPredicate(leftPredicate);
.setPredicate(rightPredicate);

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

.setPredicate(predicate)
.addNodes(leftChild, rightChild);
.setScore(this.leaf_value_[index])
.setRecordCount((double)this.leaf_count_[index])
.setPredicate(predicate);

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

.setPredicate(predicate)
.addNodes(leftChild, rightChild);

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

.setPredicate(predicate)
.addNodes(leftChild, rightChild);

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

@Override
public Node unmarshal(ComplexNode value){
  if(value.getRecordCount() != null){
    return value;
  } // End if
  if(value.hasExtensions() || (value.getPartition() != null) || value.hasScoreDistributions() || (value.getEmbeddedModel() != null)){
    return value;
  }
  Node node;
  if(value.hasNodes()){
    node = new BranchNode()
      .setId(value.getId())
      .setDefaultChild(value.getDefaultChild());
    (node.getNodes()).addAll(value.getNodes());
  } else
  {
    node = new LeafNode()
      .setId(value.getId());
  }
  node
    .setScore(value.getScore())
    .setPredicate(value.getPredicate());
  return node;
}

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

@Override
public Node unmarshal(ComplexNode value){
  if(value.getRecordCount() != null){
    return value;
  } // End if
  if(value.hasExtensions() || (value.getPartition() != null) || value.hasScoreDistributions() || (value.getEmbeddedModel() != null)){
    return value;
  }
  Node node;
  if(value.hasNodes()){
    node = new BranchNode()
      .setId(value.getId())
      .setDefaultChild(value.getDefaultChild());
    (node.getNodes()).addAll(value.getNodes());
  } else
  {
    node = new LeafNode()
      .setId(value.getId());
  }
  node
    .setScore(value.getScore())
    .setPredicate(value.getPredicate());
  return node;
}

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

.setId(id)
.setDefaultChild(leftward ? leftChild.getId() : rightChild.getId())
.setPredicate(predicate)
.addNodes(leftChild, rightChild);

相关文章