"brackets in Generate Attribute operator"
TheBen
New Altair Community Member
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.
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.
Tagged:
0
Answers
-
here is my workaround:
use "Generate Copy" to create a new attribute column without the brackets, e.g. "prediction(label)" to "predictedLabel"0 -
Instead of copying the attribute, you could simply rename it with the Rename operator.
Best, Marius0