🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Bound numeric values

User: "michaelhecht"
New Altair Community Member
Updated by Jocelyn
Hello,

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)?

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "michaelhecht"
    New Altair Community Member
    OP
    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?
    User: "michaelhecht"
    New Altair Community Member
    OP
    Ok, even if I get the impression to permanently monologize in this forum  ;)  - while searching the web I found this link here
    http://rapid-i.com/component/option,com_myblog/show,New-Feature-Script-Operator-in-RapidMiner-4.5.html/Itemid,172/lang,en/
    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)
      {
        if(example[name]<=-bound)
          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.