The Data Mining Forum                             open-source data mining software data mining conferences Data Science for Social and Behavioral Analytics DSSBA 2022 data science journal
IMPORTANT: This is the old Data Mining forum.
I keep it online so that you can read the old messages.

Please post your new messages in the new forum: https://forum2.philippe-fournier-viger.com/index.php
 
Apriori - frequent category sets
Posted by: jpen
Date: June 09, 2020 11:02AM

Hello. I'am new in the interesting world of data mining. For the course I follow I need to write all the frequent category sets with their absolute supports.

I have a dataset (txt file).

Example
Breakfast & Brunch;American (Traditional);Restaurants
Sandwiches;Restaurants
Local Services;IT Services & Computer Repair
Restaurants;Italian
Food;Coffee & Tea

In total about 78000 records.

I tried to use the Apriori algorithm but get the following error

An error occurred while trying to run the algorithm.
ERROR MESSAGE = java.lang.RuntimeException: java.lang.NumberFormatException: For input string: "Breakfast"

Can anyone tell me what I did wrong and help me to fix it.

Thanks

Options: ReplyQuote
Re: Apriori - frequent category sets
Date: June 09, 2020 05:22PM

Hi,

If you are using SPMF, you need to make sure that your file follows the correct input format. The input format is explained in the documentation.

For example, for Apriori, see the example and explanation here:
http://www.philippe-fournier-viger.com/spmf/Apriori.php

Briefly, it could be like this:

1 3 4
2 3 5
1 2 3 5
2 5
1 2 3 5

or like that if you use the GUI:

@CONVERTED_FROM_TEXT
@ITEM=1=apple
@ITEM=2=orange
@ITEM=3=tomato
@ITEM=4=milk
@ITEM=5=bread
1 3 4
2 3 5
1 2 3 5
2 5
1 2 3 5

Then using the proper format, you will get the results that you are looking for. So maybe you first need to do some preprocessing to convert your file to a suitable format.

Best regards,

Options: ReplyQuote
Re: Apriori - frequent category sets
Posted by: jpen
Date: June 10, 2020 10:19AM

Thanks for your reply.

I have transferred the dataset and it is working great.

Options: ReplyQuote
Re: Apriori - frequent category sets
Date: June 11, 2020 04:07AM

Great happy to know that it works now!

Regards

Options: ReplyQuote


This forum is powered by Phorum and provided by P. Fournier-Viger (© 2012).
Terms of use.