"brackets in Generate Attribute operator"

TheBen
TheBen New Altair Community Member
edited November 5 in Community Q&A
The generate attribute operator has a field "function expression".

If I use this field and select an attribute with brackets: prediction(label) then I get a syntax error

-> Unrecognized symbol prediction.
-> Unrecognized symbol label. (because the select attributes operator is applied)
-> syntax error (implicit multiplication not enabled)

This is what I want to implement:

function expression: attr1 + "_" + prediction(attr2) + "_" + prediction(attr3)

If I use concat(attr1, prediction(attr2)) I get the same error.

Answers

  • TheBen
    TheBen New Altair Community Member
    here is my workaround:

    use "Generate Copy" to create a new attribute column without the brackets, e.g. "prediction(label)" to "predictedLabel"
  • MariusHelf
    MariusHelf New Altair Community Member
    Instead of copying the attribute, you could simply rename it with the Rename operator.

    Best, Marius