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
 
Maximal itemset with CharmMFI
Posted by: Mari
Date: September 27, 2013 02:14PM

Hi,

please i want to modify the source of CharmMFI to extract maximal frquent itemsets;

can you please help me i would like to modify

algo2.getItemsets().printItemsets(context.size()) in order to store the itemsets in a list, array or a any other structure.


Thanks in advance

Options: ReplyQuote
Re: Maximal itemset with CharmMFI
Date: September 27, 2013 07:51PM

Hi,

I will give you the code to make a loop on all the itemsets and show them.

The idea is to use algo2.getItemsets() to obtain all the maximal itemsets found.

The itemset found are stored in an instance of the class Itemsets that store itemsets by their size. For example, itemsets of level 1 are itemsets containing 1 item. Itemsets of level 2 are itemsets containing 2 items, ....

So to access the itemsets found and print them you can do like that:

		Itemsets itemsets = algo2.getItemsets();
		for(List<Itemset> level : itemsets.getLevels()) {
			 for(Itemset itemset : level) {
				 for(Integer item : itemset.itemset) {
					 System.out.print(item );
				 }
				 System.out.println( "  support " + itemset.getAbsoluteSupport());
			 }
		}

Important: Make sure that you add the following import statement on the top of the test file:

import ca.pfv.spmf.patterns.itemset_set_integers_with_tids.*

Best,

Philippe

Options: ReplyQuote
Re: Maximal itemset with CharmMFI
Posted by: mari
Date: October 01, 2013 01:31PM

Hi,

it works very well now, many thanks i was using an old version of SPMF.


thanks once again


Best,

Options: ReplyQuote


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