Speed up : use only the top k most frequent patterns and the top k least frequent.