Commits

Tianming Lu  committed 9268351

print sorted patterns

  • Participants
  • Parent commits 481f431

Comments (0)

Files changed (1)

         print_tree(child, depth + 1)
         
 def print_patterns(patterns):
-    for p in patterns:
+    sorted_p = sorted(patterns, key = lambda p : (len(p.itemset), p.support))
+    for p in sorted_p:
         print("pattern: {0}, support:{1}".format(p.itemset, p.support))      
         
 if __name__ == "__main__":