Trying to find frequent patterns in a sequence python
There are a couple of business decisions you have to take before you will have a normal algorithm. The first and the most important decision is what size of the set do you want. Clearly if you have {a, b, ... x} is the most frequent set, then every subset (like {a, x} or {c, d, y} will be at least with the same frequency).
You need to know which one do you need (may be all or any). Also what would you do in case of these frequencies {a, b} with frequency 100 and {a, c, d, e, f, g} with frequency 20. Clearly the first one is more frequent, but the second is also pretty frequent and really long.

One way to approach this is to iterate over all 1 element subsequences and find their frequency. Then all 2 element and so on. Then create some weighted score which can be the frequency multiplied by some function based on the length of the sequence. Select the highest score.
I am trying to find frequent ( ordered or unordered) patterns in a column. The column contains numeric IDs. for eg:
s=[1 2 3 4 1 2 6 7 8 2 1 10 11]
Here 1 2 or 2 1 taking as a same case is the most frequent set. 
Please help me to solve this problem, I could think of apriori, FP algorithms but I don't have any transaction, just a sequence.