private String getNodeId(MissingValueStrategyType missingValueStrategy) throws Exception {
    ModelEvaluator<?> evaluator = createModelEvaluator();

    TreeModel treeModel = (TreeModel) evaluator.getModel();
    treeModel.setMissingValueStrategy(missingValueStrategy);

    Map<FieldName, ?> arguments =
        createArguments("outlook", "sunny", "temperature", null, "humidity", null);

    Map<FieldName, ?> result = evaluator.evaluate(arguments);

    return getEntityId(result.get(evaluator.getTargetField()));
  }
示例#2
0
  public static Map<FieldName, ? extends Classification> evaluateClassification(
      Classification value, ModelEvaluationContext context) {
    ModelEvaluator<?> evaluator = context.getModelEvaluator();

    return evaluateClassification(evaluator.getTargetField(), value, context);
  }
示例#3
0
  public static Map<FieldName, ?> evaluateRegression(Double value, ModelEvaluationContext context) {
    ModelEvaluator<?> evaluator = context.getModelEvaluator();

    return evaluateRegression(evaluator.getTargetField(), value, context);
  }