Posts

Showing posts with the label data-mining

How to create list of sets with k+1 elements from list of set with k elements if order does not matter?

How to create list of sets with k+1 elements from list of set with k elements if order does not matter? I am trying to implement a variant of the Apriori algorithm which involves forming lists of sets of size k+1 from lists of sets of size k. For example, if I had list [[1], [2], [3], [4]], I would like to form list [[1,2], [1,3], [1,4], [2,3], [2,4], [3,4]] and then[[1,2,3], [1,2,4], [2,3,4]]. I have considered using a LinkedHashSet data structure to prune out repeated elements, but LinkedHashSets don't prune out cases in structure [x, y] [y, x] which I want removed. Does anyone have any suggestions or experience in stuff like this? Thanks Do post the code which you have tried till now while asking questions on SO. – Pramod Jun 29 at 16:00 2 Answers 2 ...