Formatting data for use in Apriori

Hello, new to knime. I have a database table that I would like to perform Itemset Frequency Analysis (Apriori) on, as such I am trying to create a transaction list. I’ve filtered the table into the two needed columns; a Customer Id and a Product ID. Using the Group By node, the table is in a format where one Customer entry with numerous products, essesntially a list of transactions made by every unique customer.

I tried to feed this into the WEKA Apriori node, but apparently it doesn’t work with strings, how can I format it to work properly?

Welcome to the forum @iank_23.

I tried to feed this into the WEKA Apriori node, but apparently it doesn’t work with strings, how can I format it to work properly?

As far as I can tell, the Apriori node does work with strings.

Using the Group By node, the table is in a format where one Customer entry with numerous products, essesntially a list of transactions made by every unique customer.

I believe that this is the problem. I think that the data should be formatted like this:

And the Apriori node gives an output that looks like this (you’d have to play around with the settings):

Alternatively, you could use the Association Rule Learner node. You’d convert your concatenated list to a collection:

then apply the Association Rule Learner node:

6 Likes

Thanks for the reply. Could you please explain how to achieve the formatting of the first image?

@iank_23 in addition I can offer this collection of rule algorithms

2 Likes

Thanks, but for some reason I still cant get any of these to work. I think my list should be read as nominal values but all I get is this:

ERROR Apriori (3.7)        5:14       Execute failed: Weka associator cannot work with given data. Reason: weka.associations.Apriori: Cannot handle string attributes!

Any help appreciated.

Could you share the workflow you used if possible?

This is what I put together:

2 Likes