The Data Mining Forum                             open-source data mining software data science journal data mining conferences high utility mining workshop
This forum is about data mining, data science and big data: algorithms, source code, datasets, implementations, optimizations, etc. You are welcome to post call for papers, data mining job ads, link to source code of data mining algorithms or anything else related to data mining. The forum is hosted by P. Fournier-Viger. No registration is required to use this forum!.  
Unable to run SPADE algorithm
Posted by: Amit Chandak
Date: October 01, 2013 07:50AM

Hi Philippe,
I have downloaded the latest jar from your site and was trying to run SPADE algorithm using the command as given here
http://www.philippe-fournier-viger.com/spmf/index.php?link=documentation.php#spade

"java -jar spmf.jar run SPADE contextPrefixSpan.txt output.txt 50% 100"

But the output file is empty. It doesn't show any run-time stats like it does for Prefix Span

============= PREFIXSPAN - STATISTICS =============
Total time ~ 10 ms
Frequent sequences count : 53
Max memory (mb) : 1.092636108398437553
===================================================

Can you please help.

Thanks,
Amit.

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Date: October 01, 2013 05:36PM

Hi Amit,

Thanks for reporting the problem.

I have checked it. I have regenerated the JAR file and ZIP file for the source code. You can download them from the website to make sure that you have the latest version.

After that, one reason why it may not be working is if you don't have the file contextPrefixSpan.txt in the same directory as SPMF.JAR.

If you put the file in the same directory than it will work.

I think that the problem may just be that you did not put this file in the same directory.

To get the test files such as contextPrefixSpan.txt, you can go in the download section of SPMF and download test_files.zip.

Best,

Philippe

On my computer it works. Let me know if this still does not work.

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: Amit Chandak
Date: October 01, 2013 07:00PM

Hi Philippe,
It is working now. Thanks a lot smiling smiley

Regards,
Amit

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Date: October 01, 2013 07:26PM

You are welcome!

Philippe

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: Alaya
Date: September 15, 2019 08:15AM

How can I download the source code and on which platform i can run it? Kindly tell the website link for download the code too.

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: Alaya
Date: September 15, 2019 09:11AM

Hi, loving your algorithms. I can't figure out why the output file i choose is empty. Read your forum but still don't get that which file to copy and where.

Options: ReplyQuote
Re: How to run only SPADE algorithm in eclipse
Posted by: Pinkal
Date: May 27, 2014 06:54AM

Hello Philippe,

Thanks for your research papers it's really helpful,

But i want to run SPADE algorithm in Source code mode. I dont knw how to do that.

Can you Please help with that.

Thanking You,
Pinkal

Options: ReplyQuote
Re: How to run only SPADE algorithm in eclipse
Date: May 27, 2014 03:39PM

Hi,

If you want to copy only the source code of SPADE, you can do as follows.

1) First you need to find all the files that are used by SPADE. You would need to copy:

- all the files in the folder ca/pfv/spmf/algorithms/sequentialpatterns/spade_spam_AGP
except AlgoSPAM_AGP and AlgoCMSPADE

- this file: ca/pfv/spmf/tools/MemoryLogger

- then copy also the files ca/pfv/spmf/tests/MainTestSPADE.... that you need for running the algorithm

2) After that, if you don't want to keep the package hierarchy (the folders like ca/pfv/spmf" you would need to edit each file to remove the "package" statement on the first line and to fix the import statements in each file, which is not very complicated to do.

Best,

Options: ReplyQuote
source code of spade and gsp
Posted by: Chanchl
Date: December 05, 2014 01:46AM

i have to implement gsp and spade algorithm n java..can u plz provide me the source code.wll be thankful to you..

Options: ReplyQuote
Re: source code of spade and gsp
Date: December 05, 2014 06:10AM

You can download the Java source code of GSP and SPADE as part of the SPMF Java open-source data mining library:



Edited 3 time(s). Last edit at 12/05/2014 06:12AM by webmasterphilfv.

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: chanchl
Date: December 11, 2014 07:53AM

Thank you for reply...I am not getting hw can i run only spade algorithm...

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Date: December 11, 2014 09:44AM

If you read the instructions on the download page, it is explained how to run algorithms.

It explains that there is a GUI but you can also run algorithms from the command line or from the source code. It also explains that there is a documentation explaining how to run each algorithm on the website.

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: chanchl
Date: December 11, 2014 11:31PM

Thank u very much for ur reply...smiling smiley

Options: ReplyQuote
gsp algorithm
Posted by: chanchl
Date: December 12, 2014 01:16AM

Sir i m unable to find gsp input file which is required to run the algorithm in gui....

Options: ReplyQuote
Re: gsp algorithm
Date: December 12, 2014 03:48AM

The documentation is here:

http://www.philippe-fournier-viger.com/spmf/index.php?link=documentation.php

Click on example #47:

http://www.philippe-fournier-viger.com/spmf/index.php?link=documentation.php#gsp

It describes how to use GSP and explains that the sample input file used in this example is named "contextPrefiSpan.txt

It also explain the input format and output format.

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: chanchl
Date: December 12, 2014 05:48AM

Sir can u plz provide me examples of gsp and spade algorithms...so that I can understand the algorithms in more better way...I searched for the examples..Bt nowhere I can found examples.plz if possible provide me with examples..


Thanks

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Date: December 12, 2014 06:28AM

You may start by reading the original articles.

GSP: http://www.philippe-fournier-viger.com/spmf/GSP96.pdf

SPADE: http://www.philippe-fournier-viger.com/spmf/SPADE.pdf

You may also check the book by M. Zaki (authors of SPade), which explains GSP, SPade, etc.

http://www.cs.rpi.edu/~zaki/PaperDir/DMABOOK.pdf

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: chanchl
Date: January 09, 2015 06:13PM

Sir..does this gsp program also contains time constraint and window size...
I want program having tym constraint and window size...
I have read many papers Bt no where I can get the exact way of how candidates are exactly
Formed...from 2-sequence to 3 candidate generation...plz help me...
And also how can we optimize gsp algorithm for future research work...plz give me some solution...

Thanks

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Date: January 10, 2015 02:53AM

No, the implementation in SPMF has no time or window size constraints. But some other algorithms in SPMF offers some constraints that are similar to this. And someone could add these constraints to the GSP implementation if they need.

For how the sequences are generated, I suggest to take the time to read the original article describing GSP carefully.If you read it carefully, it should answer your question. You can also look at the code or run it using the debuger to see how it works step by step. Or you may search some powerpoints perhaps that give some more detailed examples.

How to optimize GSP? I don't know. This is a research problem. But honestly, GSP is very very slow. It is an old algorithm. Rather than optimizing GSP, you should perhaps try to optimize a faster more recent algorithm. Look are some comparison that I have done about sequential pattern mining algorithm in my PAKDD2014 paper: Look at Figure 5. GSP is easily the worst algorithm. On some of the six charts, I did not even put a line for GSP because it just run out of memory or was too slow. In my opinion, for research you should start from a faster algorithm.

Best,

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: nivi
Date: March 20, 2015 09:28AM

Hello Philppe Sir

can these programs of gsp and Spade work on any kind data or are they just made fr a particular type of data..

one more thing....currently we hav given only 5-6 transsaction..can we also give it more transaction upto thousands or more...will it work the same...we are asked to give more transactions...plz help me out...

Thanks
Nivi

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Date: March 20, 2015 10:50AM

Hi,

Algorithms such as SPAM and SPADE are designed for finding sequential patterns in a set of sequences, that is subsequences that appear frequently in a set of sequences. A sequence is basically a list of symbols but where some symbols may also appear at the same time.
So if your data can be represented as such, then SPAM and SPADE and other similar algorithms could be applied. If you are curious, you can read the SPMF documentation of SPADE and SPAM to see exactly the input format that is used in the SPMF implementations of these algorithms.

Generally speaking, these kind of algorithms sometimes work with up to 100,000 sequences. But the performance depends on many other factors than just the number of sequences. It depends on (1) the minsup value, (2) how similar the sequences are, (3) how long the transactions are, (4) the number of items etc.

Actually, the performance depends on the size of the search space. And sometimes, even for a few sequences the search space can be huge, while for many sequences, the search space can be small, depending if these sequences are long and very similar or not, for example.

So you may try and see. But personnally, I have run sequential pattern mining algorithms on many databases with 10,000, 100,000 or even more sequences.

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: Alex
Date: November 04, 2015 02:51AM

Hello Sir. I have downloaded the packages, and then I run the MainTestCMSPADE_saveToMemory. I run well. but when I tried to modify the codes or the data of contextPrefixSpan.txt It didn't give any affection. It seems that the test always gives the same result all the time although we modify the code or sequence data. Please help me with this issue, Sir.

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: Phil
Date: November 04, 2015 03:34AM

Hi,

The test file "MainTestCMSPADE_saveToMemory" uses the file contextPrefixSpan.txt as input, located in the folder /ca/pfv/spmf/test/

If you modify that file, the result should change.

If it does not work, if may be that you did not save the file properly or saved it at another location on your hard drive.

Or if the result does not change, it may be that the change that you have made have no impact on the patterns found.

Maybe you should just try it again. I have tried the JAR file with different input files and it works fine.

Best,

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: Alex
Date: November 04, 2015 06:08AM

Thanks, it works now. when I give different sequence data on "contextPrefixSpan.txt" it gives different result.


And do you know where I can change the minimum relative and absolute support value?
Because when I change the support value on file "MainTestCMSPADE_saveToMemory", the result does not change. it always notes minimum relative support = 0.5 and minimum absolute support = 0.2

Thanks,

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: Phil
Date: November 04, 2015 04:15PM

In the class file:

MainTestCMSPADE_saveToMemory

You need to change this line:

// Load a sequence database
double support = 0.50;

If I change it to 0.20 there is 812 frequent patterns found:

Minimum relative support = 0.2 minimum absolute support: 1.0
812 frequent patterns.
============= CM-SPADE -- Algorithm - STATISTICS =============
Total time ~ 31 ms
Frequent sequences count : 812
Join count : 2122
Max memory (mb):8.450172424316406



If I change it to 0.50, there is 52 frequent patterns.


Minimum relative support = 0.5 minimum absolute support: 2.0
53 frequent patterns.
============= CM-SPADE -- Algorithm - STATISTICS =============
Total time ~ 15 ms
Frequent sequences count : 53
Join count : 103
Max memory (mb):2.6002044677734375

I think you are having issues with recompiling after you make some modifications because it works fine on my computer.



Edited 3 time(s). Last edit at 11/04/2015 04:17PM by webmasterphilfv.

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: Alex
Date: November 20, 2015 02:50AM

Hello Sir,

It works fine now. Thank you for your response. I appreciate it

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: mukesh
Date: March 01, 2017 09:00PM

heloo sir when i am ruuning spade algorithm it sat ca.pfv.spmf.test doent not had main file please help me

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Date: March 01, 2017 09:44PM

The files for running the SPADE algorithm are in the package:

ca.pfv.spmf.test.

They are named:

MainTestSPADE_AGP_.... .java

There are several examples. One of them is:

MainTestSPADE_AGP_FatBitMap_saveToFile.java

If you run that file, it will apply the SPADE algorithm and save the result to a file.



Edited 2 time(s). Last edit at 03/01/2017 09:45PM by webmasterphilfv.

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: mukesh
Date: March 03, 2017 03:58AM

thank you so much it worked

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: Alaya
Date: September 15, 2019 08:13AM

How can I download the source code for spade algo from here? http://www.philippe-fournier-viger.com/spmf/index.php?link=documentation.php#spade

Options: ReplyQuote
Re: Unable to run SPADE algorithm
Posted by: Alaya
Date: September 15, 2019 12:02PM

I got it thanks

Options: ReplyQuote


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