hatvis.patterns.frequent_itemsets#

hatvis.patterns.frequent_itemsets(data, min_support=0.1, max_size=None, algorithm='eclat', weights=None, min_size=1)[source]#

Frequent itemsets of a transaction database or of a hypergraph.

The relative support of an itemset \(X\) is \(\operatorname{supp}(X)=\sum_{T\supseteq X}w_T/\sum_T w_T\) (transaction weights \(w_T\) default to 1; for a hypergraph they are the hyperedge weights, so collapsed multi-hyperedges count with their multiplicity). min_support is relative if \(\le 1\), otherwise an absolute count.

algorithm="eclat" (Zaki 2000) explores the itemset lattice depth first with vertical tid-lists; "apriori" (Agrawal and Srikant 1994) works level by level and prunes candidates with an infrequent subset. Both give the same result. Returns a DataFrame with columns itemset (frozenset), size, count (weighted) and support, sorted by decreasing support.