# Find repeating patterns in sequence data

I have database of sequential events for multiple animals. The events are represented by integers so it looks something like:

Animal A: [1,6,4,2,5,7,8]
Animal B: [1,6,5,4,1,6,7]
Animal C: [5,4,2,1,6,4,3]


I can manually see that for each event 6 event 1 first happens. And event 4 happens quickly after a 1,6 combination. But these are easy to spot in such a small dataset, the real lists are 10000+ events per animal. Is there a way to use an algorithm or machine learning to search for these kinds of patterns?

• So, you do not know in advance how many patterns a sequence may have and the type of patterns, right? – nbro Nov 16 '20 at 11:42
• @nbro I do not no. I could manually search for patterns but I want to also find some deeper hidden patterns which may not be obvious – Bram Nov 16 '20 at 13:05