Here’s a simplified version of the 3 data sets I have:
Set A = [1, 1, 2, 2, 1, 2, 2, 1]
Set B = [2, 2, 1, 2, 2, 1, 1, 3]
Set C = [8, 4, 4, 4, 4, 9, 8, 4]
Does Haskell have any built in features for finding unspecified patterns between data sets? I’d like to run my program over 2 or more data sets, and have it report back which ones are similar, which, in this case, would be sets A and B.
If you are not talking about finding consequent intersection.
For each 2 lists we can use
intersectfunction fromData.List, which takes intersection of them.So, idea is to calculate intersection of all list and sort them.
If you are interested in founding the consequent intersection, you can use something like that:
For example:
Also we can use it for finding most similar pair of lists:
Actually, if you want to get not only one pair of lists, but all pairs that are “similar”, you can remove
snd . last . sort $and get all of them.