ClaSp

This is for discussing anything related to pattern mining (e.g. itemsets, sequential patterns, subgraph mining)
Post Reply
wind121
Posts: 2
Joined: Tue Apr 19, 2022 8:47 am

ClaSp

Post by wind121 »

hello,
I want to add a max gap constraint to the clasp algorithm implemented in SPMF to limit the distance between two items, but I don't know how to do it, or I haven't succeeded yet. could someone give me some ideas?
User avatar
admin
Site Admin
Posts: 121
Joined: Tue Apr 05, 2022 12:47 am
Location: China
Contact:

Re: ClaSp

Post by admin »

Good morning,

Sorry for the delay to answer. Been a bit busy.

I had a look at the code of ClaSP.

I think the main modifications would have to be done to the method dfsPruning() located in the file FrequentPatternEnumeration_ClaSP of the package
ca.pfv.spmf.algorithms.sequentialpatterns.clasp_AGP.

This method is the one who is doing the depth first search. So in this method, you could add the code to avoid doing an s-extension if the gap is too big.

In particular, after a quick look, I think this is the lines for the s-extension:

Code: Select all

     int sequenceExtensionSize = new_sequenceExtension.size();
        //For all the elements valuables as future s-extensions
        for (int i = 0; i < sequenceExtensionSize; i++) {
            //we get the new pattern and the nodeTrie associated with it
            Pattern newPattern = newPatterns.get(i);
            TrieNode nodeToExtend = newNodesToExtends.remove(0);

            Item last = newPattern.getIthElement(newPattern.size() - 1).getItem(); // PFV 2013

            /* And we make a recursive call to dfs_pruning with the new sequence 
             * extension. Besides we establish the same set as the set which we will
             * make the i-extensions, but beginning from the (i+1)-th element
             */
            exploreChildren(newPattern, nodeToExtend, new_sequenceExtension, new_sequenceExtension, i + 1, coocMapAfter, coocMapEquals, last);
        }
So you would probably have to add something around that place in the code.

Hope that this help you to get started.
wind121
Posts: 2
Joined: Tue Apr 19, 2022 8:47 am

Re: ClaSp

Post by wind121 »

Thank you for your reply in your busy schedule.
Lucy
Posts: 17
Joined: Sat May 28, 2022 5:06 pm

Re: ClaSp

Post by Lucy »

Could we also apply the CLASP algorithm for the graph data mining?
Ndrez
Posts: 4
Joined: Fri Apr 29, 2022 5:15 pm

Re: ClaSp

Post by Ndrez »

wind121 wrote: Thu Apr 21, 2022 12:22 pm hello,
I want to add a max gap constraint to the clasp algorithm implemented in SPMF to limit the distance between two items, but I don't know how to do it, or I haven't succeeded yet. could someone give me some ideas?
Hi,
since I am facing a similar problem, did you manage to modify the algorithm adding the max gap constraint?
Thanks.
Post Reply