Options

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

  • Options
    varunm1varunm1 Moderator, 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

  • Options
    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
  • Options
    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




  • Options
    bernardo_pagnonbernardo_pagnon Member, University Professor Posts: 64 University Professor
    Thanks, problem solved!
Sign In or Register to comment.