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

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

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

Node.setRecordCount介绍

暂无

代码示例

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

public static PMML buildDummyModel() {
 Node node = new Node().setRecordCount(123.0);
 TreeModel treeModel = new TreeModel(MiningFunction.CLASSIFICATION, null, node);
 PMML pmml = PMMLUtils.buildSkeletonPMML();
 pmml.addModels(treeModel);
 return pmml;
}

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

private static PMML buildDummyModel() {
 Node node = new Node().setRecordCount(123.0);
 TreeModel treeModel = new TreeModel(MiningFunction.CLASSIFICATION, null, node);
 PMML pmml = PMMLUtils.buildSkeletonPMML();
 pmml.addModels(treeModel);
 return pmml;
}

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

modelNode.setRecordCount((double) nodeCount);

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

Node rootNode = new Node().setId("r").setRecordCount(dummyCount).setPredicate(new True());
  .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"))

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

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

@Override
  public Node encode(Node node, int offset){
    Number score = yval.getValue(offset);
    Number recordCount = n.getValue(offset);
    node
      .setScore(score)
      .setRecordCount(recordCount.doubleValue());
    return node;
  }
};

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

@Override
  public Node encode(Node node, int offset){
    String score = categories.get(this.classes.get(offset) - 1);
    Integer recordCount = n.getValue(offset);
    node
      .setScore(score)
      .setRecordCount(recordCount.doubleValue());
    if(hasScoreDistribution){
      node = NodeUtil.toComplexNode(node);
      List<ScoreDistribution> scoreDistributions = node.getScoreDistributions();
      for(int i = 0; i < categories.size(); i++){
        List<? extends Number> recordCounts = this.recordCounts.get(i);
        ScoreDistribution scoreDistribution = new ScoreDistribution()
          .setValue(categories.get(i))
          .setRecordCount(recordCounts.get(offset).doubleValue());
        scoreDistributions.add(scoreDistribution);
      }
    }
    return node;
  }
};

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

@Override
  public void encode(Node node, LeafNode leafNode){
    int index = ValueUtil.asInt(leafNode.prediction());
    node.setScore(this.categoricalLabel.getValue(index));
    ImpurityCalculator impurityCalculator = leafNode.impurityStats();
    node.setRecordCount((double)impurityCalculator.count());
    double[] stats = impurityCalculator.stats();
    for(int i = 0; i < stats.length; i++){
      ScoreDistribution scoreDistribution = new ScoreDistribution(this.categoricalLabel.getValue(i), stats[i]);
      node.addScoreDistributions(scoreDistribution);
    }
  }
};

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

node.setRecordCount(recordCount);

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

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

相关文章