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

Changing all attributes names at once

bernardo_pagnonbernardo_pagnon Member, University Professor Posts: 64 University Professor
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

Best Answer

Answers

  • varunm1varunm1 Member Posts: 1,207 Unicorn
    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.
    Regards,
    Varun
    https://www.varunmandalapu.com/

    Be Safe. Follow precautions and Maintain Social Distancing

  • bernardo_pagnonbernardo_pagnon Member, University Professor Posts: 64 University Professor
    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_pagnonbernardo_pagnon Member, University Professor Posts: 64 University Professor
    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_pagnonbernardo_pagnon Member, University Professor Posts: 64 University Professor
    Thanks, problem solved!
Sign In or Register to comment.