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

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

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

Node.hasScoreDistributions介绍

暂无

代码示例

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

  1. @Override
  2. public VisitorAction visit(Node node){
  3. if(node.hasScoreDistributions()){
  4. List<ScoreDistribution> scoreDistributions = node.getScoreDistributions();
  5. for(ListIterator<ScoreDistribution> it = scoreDistributions.listIterator(); it.hasNext(); ){
  6. it.set(intern(it.next()));
  7. }
  8. }
  9. return super.visit(node);
  10. }

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

  1. @Override
  2. public VisitorAction visit(Node node){
  3. if(node.hasScoreDistributions()){
  4. List<ScoreDistribution> scoreDistributions = node.getScoreDistributions();
  5. for(ListIterator<ScoreDistribution> it = scoreDistributions.listIterator(); it.hasNext(); ){
  6. it.set(intern(it.next()));
  7. }
  8. }
  9. return super.visit(node);
  10. }

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

  1. @Override
  2. public VisitorAction visit(Node node){
  3. TreeModel treeModel = getTreeModel();
  4. MiningFunction miningFunction = treeModel.getMiningFunction();
  5. switch(miningFunction){
  6. case REGRESSION:
  7. if(node.hasScoreDistributions()){
  8. List<ScoreDistribution> scoreDistributions = node.getScoreDistributions();
  9. scoreDistributions.clear();
  10. }
  11. break;
  12. default:
  13. break;
  14. }
  15. return super.visit(node);
  16. }

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

  1. @Override
  2. protected <V extends Number> Map<FieldName, ?> evaluateClassification(ValueFactory<V> valueFactory, EvaluationContext context){
  3. TreeModel treeModel = getModel();
  4. TargetField targetField = getTargetField();
  5. Trail trail = new Trail();
  6. Node node = evaluateTree(trail, context);
  7. if(node == null){
  8. return TargetUtil.evaluateClassificationDefault(valueFactory, targetField);
  9. } // End if
  10. if(!node.hasScoreDistributions()){
  11. NodeVote result = createNodeVote(node);
  12. return TargetUtil.evaluateVote(targetField, result);
  13. }
  14. double missingValuePenalty = 1d;
  15. int missingLevels = trail.getMissingLevels();
  16. if(missingLevels > 0){
  17. missingValuePenalty = Math.pow(treeModel.getMissingValuePenalty(), missingLevels);
  18. }
  19. NodeScoreDistribution<V> result = createNodeScoreDistribution(valueFactory, node, missingValuePenalty);
  20. return TargetUtil.evaluateClassification(targetField, result);
  21. }

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

  1. value.setPartition(node.getPartition());
  2. if(node.hasScoreDistributions()){
  3. (value.getScoreDistributions()).addAll(node.getScoreDistributions());

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

  1. value.setPartition(node.getPartition());
  2. if(node.hasScoreDistributions()){
  3. (value.getScoreDistributions()).addAll(node.getScoreDistributions());

相关文章