Changing all attributes names at once

bernardo_pagnon
bernardo_pagnon New Altair Community Member
edited November 2024 in Community Q&A
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
Tagged:

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

Answers

  • varunm1
    varunm1 New Altair Community Member
    edited April 2020
    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.
  • bernardo_pagnon
    bernardo_pagnon New Altair Community Member
    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,
    Bernardo
  • bernardo_pagnon
    bernardo_pagnon New Altair Community Member
    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




  • bernardo_pagnon
    bernardo_pagnon New Altair Community Member
    Thanks, problem solved!

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.