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

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

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

Node.getRecordCount介绍

暂无

代码示例

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

  1. } else {
  2. prediction = new NumericPrediction(Double.parseDouble(root.getScore()),
  3. (int) Math.round(root.getRecordCount()));

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

  1. @Test
  2. public void testReadWrite() throws Exception {
  3. Path tempModelFile = Files.createTempFile(getTempDir(), "model", ".pmml");
  4. PMML model = buildDummyModel();
  5. PMMLUtils.write(model, tempModelFile);
  6. assertTrue(Files.exists(tempModelFile));
  7. PMML model2 = PMMLUtils.read(tempModelFile);
  8. List<Model> models = model2.getModels();
  9. assertEquals(1, models.size());
  10. assertInstanceOf(models.get(0), TreeModel.class);
  11. TreeModel treeModel = (TreeModel) models.get(0);
  12. assertEquals(123.0, treeModel.getNode().getRecordCount().doubleValue());
  13. assertEquals(MiningFunction.CLASSIFICATION, treeModel.getMiningFunction());
  14. }

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

  1. Node leftChild = children.get(1);
  2. assertInstanceOf(leftChild.getPredicate(), True.class);
  3. assertEquals(node.getRecordCount().doubleValue(),
  4. leftChild.getRecordCount() + rightChild.getRecordCount());
  5. assertEquals(node.getId() + "+", rightChild.getId());
  6. assertEquals(node.getId() + "-", leftChild.getId());

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

  1. @Override
  2. public int compare(Node left, Node right){
  3. return this.ordering.compare(left.getRecordCount(), right.getRecordCount());
  4. }
  5. };

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

  1. @Override
  2. public int compare(Node left, Node right){
  3. return this.ordering.compare(left.getRecordCount(), right.getRecordCount());
  4. }
  5. };

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

  1. @Override
  2. public VisitorAction visit(Node node){
  3. Deque<PMMLObject> parents = getParents();
  4. int depth = 0;
  5. Iterator<PMMLObject> it = parents.iterator();
  6. while(true){
  7. PMMLObject parent = it.next();
  8. if(parent instanceof Node){
  9. depth++;
  10. continue;
  11. }
  12. TreeModel treeModel = (TreeModel)parent;
  13. Segment segment = (Segment)it.next();
  14. Double recordCount = node.getRecordCount();
  15. if(recordCount == null){
  16. recordCount = 0d;
  17. }
  18. printRow(segment.getId(), node.getId(), recordCount, depth);
  19. break;
  20. }
  21. return super.visit(node);
  22. }

代码示例来源: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: com.cloudera.oryx/oryx-app-common

  1. } else {
  2. prediction = new NumericPrediction(Double.parseDouble(root.getScore()),
  3. (int) Math.round(root.getRecordCount()));

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

  1. static
  2. public ComplexNode toComplexNode(Node node){
  3. ComplexNode result = new ComplexNode()
  4. .setId(node.getId())
  5. .setScore(node.getScore())
  6. .setRecordCount(node.getRecordCount())
  7. .setDefaultChild(node.getDefaultChild())
  8. .setPredicate(node.getPredicate());
  9. if(node.hasNodes()){
  10. (result.getNodes()).addAll(node.getNodes());
  11. } // End if
  12. if(node.hasScoreDistributions()){
  13. (result.getScoreDistributions()).addAll(node.getScoreDistributions());
  14. }
  15. return result;
  16. }
  17. }

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

  1. Double recordCount = node.getRecordCount();

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

  1. value.setRecordCount(node.getRecordCount());
  2. value.setDefaultChild(node.getDefaultChild());

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

  1. value.setRecordCount(node.getRecordCount());
  2. value.setDefaultChild(node.getDefaultChild());

相关文章