コード例 #1
0
  @Override
  public String toResultString() {
    StringBuilder builder = new StringBuilder();

    builder.append(
        "Denormalization Model of the following Normalization:" + Tools.getLineSeparator());
    builder.append(invertedModel.toResultString());

    return builder.toString();
  }
コード例 #2
0
  @Override
  public void doWork() throws OperatorException {
    AbstractNormalizationModel model = modelInput.getData(AbstractNormalizationModel.class);

    // check how to behave if an Attribute is missing in the input ExampleSet
    if (getParameter(PARAMETER_MISSING_ATTRIBUTES_KEY).equals(FAIL_ON_MISSING)) {
      failOnMissingAttributes = true;
    } else {
      failOnMissingAttributes = false;
    }

    Map<String, LinearTransformation> attributeTransformations = new HashMap<>();
    for (Attribute attribute : model.getTrainingHeader().getAttributes()) {
      double b = model.computeValue(attribute, 0);
      double a = model.computeValue(attribute, 1) - b;

      attributeTransformations.put(attribute.getName(), new LinearTransformation(a, b));
    }

    modelOutput.deliver(
        new DenormalizationModel(
            model.getTrainingHeader(), attributeTransformations, model, failOnMissingAttributes));
    originalModelOutput.deliver(model);
  }