org.dmg.pmml.Visitor类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(102)

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

Visitor介绍

暂无

代码示例

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

public void applyTo(Visitable visitable){
    List<Class<? extends Visitor>> visitorClazzes = this;

    for(Class<? extends Visitor> visitorClazz : visitorClazzes){
      Visitor visitor;

      try {
        visitor = visitorClazz.newInstance();
      } catch(ReflectiveOperationException roe){
        throw new RuntimeException(roe);
      }

      visitor.applyTo(visitable);
    }
  }
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

public void applyTo(Visitable visitable){
    List<Class<? extends Visitor>> visitorClazzes = this;

    for(Class<? extends Visitor> visitorClazz : visitorClazzes){
      Visitor visitor;

      try {
        visitor = visitorClazz.newInstance();
      } catch(ReflectiveOperationException roe){
        throw new RuntimeException(roe);
      }

      visitor.applyTo(visitable);
    }
  }
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

public MiningModel encodeMiningModel(Map<String, ?> options, Schema schema){
  Boolean compact = (Boolean)options.get(HasLightGBMOptions.OPTION_COMPACT);
  Integer numIterations = (Integer)options.get(HasLightGBMOptions.OPTION_NUM_ITERATION);
  MiningModel miningModel = this.object_function_.encodeMiningModel(Arrays.asList(this.models_), numIterations, schema)
    .setAlgorithmName("LightGBM");
  if((Boolean.TRUE).equals(compact)){
    Visitor visitor = new TreeModelCompactor();
    visitor.applyTo(miningModel);
  }
  return miningModel;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

/**
 * @see XGBoostUtil#toXGBoostSchema(Schema)
 */
public MiningModel encodeMiningModel(Map<String, ?> options, Schema schema){
  Boolean compact = (Boolean)options.get(HasXGBoostOptions.OPTION_COMPACT);
  Integer ntreeLimit = (Integer)options.get(HasXGBoostOptions.OPTION_NTREE_LIMIT);
  MiningModel miningModel = this.gbtree.encodeMiningModel(this.obj, this.base_score, ntreeLimit, schema)
    .setAlgorithmName("XGBoost");
  if((Boolean.TRUE).equals(compact)){
    Visitor visitor = new TreeModelCompactor();
    visitor.applyTo(miningModel);
  }
  return miningModel;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

/**
 * @see XGBoostUtil#toXGBoostSchema(Schema)
 */
public MiningModel encodeMiningModel(Map<String, ?> options, Schema schema){
  Boolean compact = (Boolean)options.get(HasXGBoostOptions.OPTION_COMPACT);
  Integer ntreeLimit = (Integer)options.get(HasXGBoostOptions.OPTION_NTREE_LIMIT);
  MiningModel miningModel = this.gbtree.encodeMiningModel(this.obj, this.base_score, ntreeLimit, schema)
    .setAlgorithmName("XGBoost");
  if((Boolean.TRUE).equals(compact)){
    Visitor visitor = new TreeModelCompactor();
    visitor.applyTo(miningModel);
  }
  return miningModel;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

private <P extends Number> TreeModel encodeTreeModel(MiningFunction miningFunction, ScoreEncoder<P> scoreEncoder, List<? extends Number> leftDaughter, List<? extends Number> rightDaughter, List<P> nodepred, List<? extends Number> bestvar, List<Double> xbestsplit, Schema schema){
  RGenericVector randomForest = getObject();
  Node root = encodeNode(new True(), 0, scoreEncoder, leftDaughter, rightDaughter, bestvar, xbestsplit, nodepred, new CategoryManager(), schema);
  TreeModel treeModel = new TreeModel(miningFunction, ModelUtil.createMiningSchema(schema.getLabel()), root)
    .setMissingValueStrategy(TreeModel.MissingValueStrategy.NULL_PREDICTION)
    .setSplitCharacteristic(TreeModel.SplitCharacteristic.BINARY_SPLIT);
  if(this.compact){
    Visitor visitor = new RandomForestCompactor();
    visitor.applyTo(treeModel);
  }
  return treeModel;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}

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

@Override
  public VisitorAction accept(Visitor visitor){
    VisitorAction status = visitor.visit(this);

    if(status == VisitorAction.CONTINUE){
      visitor.pushParent(this);
      visitor.popParent();
    } // End if

    if(status == VisitorAction.TERMINATE){
      return VisitorAction.TERMINATE;
    }

    return VisitorAction.CONTINUE;
  }
}

相关文章