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
Syntax Error - Generate Macro
I'm trying to build up a string to use as a file name but I'm having trouble getting the macro to generate correctly
My generate macro expression is
str('Var1') + "_" + str('Var2') +" _" + str('Var3') +".txt"
where Var1,2,3 are attributes from the exampleset
what I'd like to end up with is a macro value like
Team2_Results_Summer.txt
Team2_Predict_Summer.txt
Team9_Results_Spring.txt
but all I get is a Syntax error even when the function express says the "Expression is syntactically correct" and the process won't continue after the Generate Macro operator
My generate macro expression is
str('Var1') + "_" + str('Var2') +" _" + str('Var3') +".txt"
where Var1,2,3 are attributes from the exampleset
what I'd like to end up with is a macro value like
Team2_Results_Summer.txt
Team2_Predict_Summer.txt
Team9_Results_Spring.txt
but all I get is a Syntax error even when the function express says the "Expression is syntactically correct" and the process won't continue after the Generate Macro operator
0
Answers
com.rapidminer.operator.UserError: Generation exception: 'Syntax error'
which doesn't really go a long way to helping me debug the problem.
I'm trying to create a unique filename for each entry in an exampleset so I can write a document (collection of tokens) to disk with 1 file per example set record
don't use quotes around the variable names. it is:
str(att1) + "_" + str(att2) +" _" + str(att3) +".txt"
or
str([att1]) + "_" + str([att2]) +" _" + str([att3]) +".txt"
~Martin
Dortmund, Germany
I get the error
Generation exception: 'Unrecognized symbol "att1"
Unrecognized symbol "att2"
Unrecognized symbol "att3"
'
Dortmund, Germany
The values are also listed in the attributes pane of the functions expressions screen of generate macro operator
which version of RapidMiner Studio are you using?
Regards,
Marco