The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

"Generate Attribute - Deviation"

MuehliManMuehliMan Member Posts: 85 Maven
edited June 2019 in Help
Hi,

I would like to include an Operator that calculates the deviation for each example. I thought this is an easy job, but I am struggeling to include the predition(activity) attribute into the right Syntax.Here is what I tried:
      </operator>
      <operator activated="true" class="generate_attributes" compatibility="5.0.8" expanded="true" height="76" name="Generate Deviation" width="90" x="447" y="30">
        <list key="function_descriptions">
          <parameter key="deviatio" value="%{activity}-%{prediction(activity)}"/>
        </list>
      </operator>
Thanks for your help!

Cheers,
Markus

Answers

  • colocolo Member Posts: 236 Maven
    Hi Markus,

    if 'activity' and 'prediction(activity)' are attributes, you may not write them with macro-syntax. %{macro-name} resolves the value for the macro 'macro-name' and inserts it in this place. If you want to use attributes inside the "Generate Attributes" operator simply use their names (case-sensitive) without special syntax. If you want to use text/string content you have to quote it here.

    If you want to do some calculation with different attributes they need to have same types, maybe some conversion is required before this step.

    Hope this helps!?

    Greetings,
    Matthias
  • MuehliManMuehliMan Member Posts: 85 Maven
    So as prediction and label are different types, I need to perform a type conversion beforehands? In my case all values are numerical.
  • colocolo Member Posts: 236 Maven
    Roles may be different, as long as value types are the same this should work.

    I just tested a similar (constructed) example, it seems the parentheses cause problems when trying the calculation. If you rename the attribute before (prediction_activity for example) this should work!
  • MuehliManMuehliMan Member Posts: 85 Maven
    this solved the problem, thank you!
Sign In or Register to comment.