Skip to content

Instantly share code, notes, and snippets.

from IPython import get_ipython
from IPython.core.magic import register_cell_magic
from tornado import ioloop
from functools import partial
josh-howes /
Created Nov 17, 2015
Han, Pei and Yin's novel frequent pattern tree (FP-tree) structure
"""Mining Frequent Patterns without Candidate Generation.
Naive implementation of the data structures in the following paper <>
class HeaderTable(dict):
"""Header Table.
To facilitate tree traversal, an item header table is built in which each item points to its
occurrence in the tree via a head of node-link. Nodes with the same item-name are linked in
josh-howes /
Last active Nov 13, 2015
Add Decorating of Abstract Class Methods
from abc import ABCMeta, abstractmethod
import types
import time
from functools import wraps
def with_timing(f):
def wrapper(*args, **kwds):
time_start = time.time()