Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
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