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
Customer basket analysis (Data preparation)
Hello
I work on customer basket analysis. I have a dataset like this for each customer basket:
Name Number price customer
pen 2 10 1
bread 10 20 1
fish 2 30 1
...................................................................................................
bread 3 15 2
salt 1 2 2
...................................................................................................
pen 3 15 3
bag 1 50 3
Now I want to make columns for each Name and delete duplicate Names so I should change each row to the column then analyse them but I don't know how it is possible with RM? Also I should separate each customer basket from each other in to new rows. So it must be like this: ( for each Name which is in the basket of customer I should have "True" and which is not "False" in the row of that customer.)
Customer pen bread fish salt bag
1 True True True False False
2 False True False True False
3 True False False False True
Can any body guide me? Also it is big data
Thank you in advance
Sara
I work on customer basket analysis. I have a dataset like this for each customer basket:
Name Number price customer
pen 2 10 1
bread 10 20 1
fish 2 30 1
...................................................................................................
bread 3 15 2
salt 1 2 2
...................................................................................................
pen 3 15 3
bag 1 50 3
Now I want to make columns for each Name and delete duplicate Names so I should change each row to the column then analyse them but I don't know how it is possible with RM? Also I should separate each customer basket from each other in to new rows. So it must be like this: ( for each Name which is in the basket of customer I should have "True" and which is not "False" in the row of that customer.)
Customer pen bread fish salt bag
1 True True True False False
2 False True False True False
3 True False False False True
Thank you in advance
Sara
Tagged:
0
Answers
Here's a good tutorial on how to prepare the data and implement market basket analysis in RapidMiner.
https://academy.rapidminer.com/learn/article/cross-selling-do-you-want-fries-with-that
Cheers,
Pavithra
Hello
Thank you for the answer and the link was great but I don't know how to clean my data?
I don't know how to change the place of rows to columns?
Please read my question and the sample data again.
Regards
Sara
The easiest way is to use Pivot option in 'Turbo Prep'
Then just replace missing with false and no-missing with true (you can do this in Turbo Prep or open the process in 'Design' mode and use operators). Rename the columns accordingly.
I hope this helps.
Cheers
Pavithra
Thank you very much for your help but how can I change each row to the column?
The best way to achieve that in my opinion is to convert the columns to text and use value map and replace operators.
Check out the XML of the process.
Harshit