PrefixSpan-py
PrefixSpan-py copied to clipboard
Configure minlen, maxlen outside instead of hardcode to 1 and 1000 respectively
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.
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.
Hello @abhi-rawat1,
I found a work around for setting the minlen, maxlen from digging into the codebase.
preprocess = self.execution_paths ps = PrefixSpan(preprocess) ps.minlen = 5 ps.maxlen = 15 top5 = ps.topk(40, closed = True)
See the sample code.