Association Rules/Market Basket Analysis Dataset

Afternoon!

I need to produce an association rules work flow based on a shopping list. The dataset is CSV so I don’t seem to be able to upload it. The confusion I’m having is that all the examples and practice exercises I’ve worked with has has all the items in one cell, not split into individual cells like this. (I’ve try to upload an image). I’ve tried to work with the file as it is but so far no luck in getting anything useful (yet!). I was wondering should I merge the cells into one list? I tried column combine but rows have different items so when I combine all the columns I get a bunch of messy ? and “”. What would be the optimum approach?

Hello @Sarah_Dunn ,
If I am assuming correctly, Each row of your data is a shopping list and you want 1 shopping list in one cell.
If this is the case you can use

column aggregator

with these options

For Example

image
becomes
image

You can also keep a delimiter “,” to get something like

image

Please let me know if I am mistaken

1 Like

Thanks so much! That did indeed do what I want but it wasn’t the solution to getting this association rules workflow to work :frowning:

Can you be a bit more specific about what the idea behind this is? What is the expected output? Can you draft an example? What have you tried so far? The more you can provide (data, screenshots, workflows, etc.), the better people will be able to help you out :wink: Are you looking for similarities between shopping lists?

If you convert the csv to an Excel sheet, you are able to upload it the forum so people can work with the same data.

@Sarah_Dunn you could check these examples and see if they can help you

Then there is this blog and examples

3 Likes

It’s tricky, because it’s my assignment for Uni. Our practice data sets were structured differently to this set so the methods don’t work. I did Domain Calculator to unrestrict the limits then One to Many but it’s just created a load of duplicates. Fortunately it’s a tiny bit of the assignment so I can move onto something else that (hopefully) I can get my head around! Thank you for offering to help

groceries - groceries (1).xlsx (261.9 KB)
Afternoon!
My assignment is all handed in and I didn’t get it to work but I would like to understand where I went wrong, this is the workflow I started following what I had been taught in class, but I would be interested to learn how others would of approached it so I know next time (and I can see this being really useful in my job!)
AssoRules.knwf (1.2 MB)

1 Like

Hi @Sarah_Dunn -

Here’s what I would have done as a first stab at your problem. The Borgelt node wants a collection as input, and an easy way to generate one is with the Create Collection Column node:

2022-08-22 10_57_25-Window

Using your Borgelt node config I get something like this:

2 Likes

I can’t believe it was so simple! Why oh why did try they try to make it so much more complicated than it needs to be!?!!!

Thank you for your solution,

1 Like