🦉 🎤   RapidMiner Wisdom 2020 - CALL FOR SPEAKERS   🦉 🎤

We are inviting all community members to submit proposals to speak at Wisdom 2020 in Boston.

Whether it's a cool RapidMiner trick or a use case implementation, we want to see what you have.
Form link is below and deadline for submissions is November 15. See you in Boston!


Bound numeric values

michaelhechtmichaelhecht Member Posts: 89  Guru

I have some values which are beyond -3 and +3 after z-score normalization. I would like to bound those values since I'm sure that the direction is ok but the absolute value to extrem. How can I do this (shortest soluton)?


  • michaelhechtmichaelhecht Member Posts: 89  Guru
    Could anyone post a groovy code example how to bound the values of one or more columns
    to a defined value? Or is there a documentation of how to apply Groovy to make this myself?
  • michaelhechtmichaelhecht Member Posts: 89  Guru
    Ok, even if I get the impression to permanently monologize in this forum  ;)  - while searching the web I found this link here
    with an example which I customized to:

    ExampleSet exampleSet = operator.getInput(ExampleSet.class);

    for (Attribute attribute : exampleSet.getAttributes())
      String name = attribute.getName();
      double bound = 3;
      for (Example example : exampleSet)
          example[name] = -bound;
        else if(example[name]>=bound)
          example[name] = bound;

    return exampleSet;
    This will do the job, even if I don't know currently how to access also the label value.
Sign In or Register to comment.