PrefixSpan-py icon indicating copy to clipboard operation
PrefixSpan-py copied to clipboard

Configure minlen, maxlen outside instead of hardcode to 1 and 1000 respectively

Open abhi-rawat1 opened this issue 4 years ago • 2 comments

Hello,

I do have a requirement where I need to find matching patterns (along with theirs frequency counters) from given input list stating each matched pattern length should be greater than 5. I noticed that there is an one parameter named as 'minlen' that can be used for this purpose.

So is it possible to configure minlen, maxlen outside instead of hardcode to 1 and 1000 respectively? Or is there any other way to achieve this requirement?

Please let me know if you need any details on that.

abhi-rawat1 avatar Jun 29 '20 23:06 abhi-rawat1

I have the same query. I can see that from cli this two parameters can be set. But is there any way to set them in the API? Having the way in the documentation might improve the quality as well. Thanks in advance.

avijit1258 avatar Jul 25 '20 08:07 avijit1258

Hello @abhi-rawat1,

I found a work around for setting the minlen, maxlen from digging into the codebase. Screen Shot 2020-07-25 at 2 48 15 AM

preprocess = self.execution_paths ps = PrefixSpan(preprocess) ps.minlen = 5 ps.maxlen = 15 top5 = ps.topk(40, closed = True)

See the sample code.

avijit1258 avatar Jul 25 '20 08:07 avijit1258