Changing all attributes names at once

bernardo_pagnon
New Altair Community Member
Hello,
I am doing a market basket analysis exercise and I loaded the data using the "items in separate columns" option in the FP-Growth operator. All is working fine, but the names of the attributes are all att1, att2, etc. I have 50 attributes, and I have their names stored in a separate file. How can I change their names automatically, without having to enter them one-by-one using the Rename operator?
Regards,
Bernardo
I am doing a market basket analysis exercise and I loaded the data using the "items in separate columns" option in the FP-Growth operator. All is working fine, but the names of the attributes are all att1, att2, etc. I have 50 attributes, and I have their names stored in a separate file. How can I change their names automatically, without having to enter them one-by-one using the Rename operator?
Regards,
Bernardo
Tagged:
0
Best Answer
-
Hello @bernardo_pagnon
You just need to add "Guess Types" operator at the end of your process to resolve this. I attached the modified XML code.5
Answers
-
My idea is to import the names from CSV into repository as a dataset and append them to existing file using append operator. Then use "Rename by example value" operator and specify that row as the name.0
-
Thanks for the reply varunm1. I believe it is trickier because the file has what FP-Growth calls "items in separate columns". So I have very few columns (8), and 50 attributes. I don't know how to make RM understand that the goods list is what gives the attribute names, and that each column is just the number of items bought per customer. I am attaching the files in case you want to take a look.Best,Bernardo0
-
Hello varunm1,I followed your suggestion in a simpler bakery example and it works! But there is something weird going on: the former example (which is now a header for each attribute) still appears as one possible outcome on each column:That is strange, I thought the example was completely removed, they should not appear under Least! Why RM keeps them alive despite the fact that they are now naming the attributes?Regards,Bernardo
0 -
Hello @bernardo_pagnon
You just need to add "Guess Types" operator at the end of your process to resolve this. I attached the modified XML code.5 -
Thanks, problem solved!
0