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

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

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

  1. public static PMML buildDummyModel() {
  2. Node node = new Node().setRecordCount(123.0);
  3. TreeModel treeModel = new TreeModel(MiningFunction.CLASSIFICATION, null, node);
  4. PMML pmml = PMMLUtils.buildSkeletonPMML();
  5. pmml.addModels(treeModel);
  6. return pmml;
  7. }

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

  1. private static PMML buildDummyModel() {
  2. Node node = new Node().setRecordCount(123.0);
  3. TreeModel treeModel = new TreeModel(MiningFunction.CLASSIFICATION, null, node);
  4. PMML pmml = PMMLUtils.buildSkeletonPMML();
  5. pmml.addModels(treeModel);
  6. return pmml;
  7. }

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

  1. modelNode.setRecordCount((double) nodeCount);

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

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

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

  1. Node rootNode = new Node().setId("r").setRecordCount(dummyCount).setPredicate(new True());
  2. Node left = new Node().setId("r-").setRecordCount(halfCount).setPredicate(new True());
  3. left.addScoreDistributions(new ScoreDistribution("apple", halfCount));
  4. Node right = new Node().setId("r+").setRecordCount(halfCount)
  5. .setPredicate(new SimpleSetPredicate(FieldName.create("color"),
  6. SimpleSetPredicate.BooleanOperator.IS_NOT_IN,

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

  1. @Override
  2. public Node encode(Node node, int offset){
  3. Number score = yval.getValue(offset);
  4. Number recordCount = n.getValue(offset);
  5. node
  6. .setScore(score)
  7. .setRecordCount(recordCount.doubleValue());
  8. return node;
  9. }
  10. };

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

  1. @Override
  2. public Node encode(Node node, int offset){
  3. String score = categories.get(this.classes.get(offset) - 1);
  4. Integer recordCount = n.getValue(offset);
  5. node
  6. .setScore(score)
  7. .setRecordCount(recordCount.doubleValue());
  8. if(hasScoreDistribution){
  9. node = NodeUtil.toComplexNode(node);
  10. List<ScoreDistribution> scoreDistributions = node.getScoreDistributions();
  11. for(int i = 0; i < categories.size(); i++){
  12. List<? extends Number> recordCounts = this.recordCounts.get(i);
  13. ScoreDistribution scoreDistribution = new ScoreDistribution()
  14. .setValue(categories.get(i))
  15. .setRecordCount(recordCounts.get(offset).doubleValue());
  16. scoreDistributions.add(scoreDistribution);
  17. }
  18. }
  19. return node;
  20. }
  21. };

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

  1. @Override
  2. public void exitNode(Node node){
  3. Double recordCount = node.getRecordCount();
  4. Predicate predicate = node.getPredicate();
  5. if(recordCount != null){
  6. node.setRecordCount(null);
  7. } // End if
  8. if(predicate instanceof True){
  9. Node parentNode = getParentNode();
  10. if(parentNode == null){
  11. return;
  12. }
  13. initScore(parentNode, node);
  14. replaceChildWithGrandchildren(parentNode, node);
  15. }
  16. }

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

  1. @Override
  2. public void encode(Node node, LeafNode leafNode){
  3. int index = ValueUtil.asInt(leafNode.prediction());
  4. node.setScore(this.categoricalLabel.getValue(index));
  5. ImpurityCalculator impurityCalculator = leafNode.impurityStats();
  6. node.setRecordCount((double)impurityCalculator.count());
  7. double[] stats = impurityCalculator.stats();
  8. for(int i = 0; i < stats.length; i++){
  9. ScoreDistribution scoreDistribution = new ScoreDistribution(this.categoricalLabel.getValue(i), stats[i]);
  10. node.addScoreDistributions(scoreDistribution);
  11. }
  12. }
  13. };

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

  1. node.setRecordCount(recordCount);

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

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

相关文章