hatvis.patterns#

Frequent patterns and hypergraphs.

A transaction database \(\mathcal{T}\) is a hypergraph: items are vertices and every transaction is a hyperedge. Frequent itemsets are vertex sets that are contained in many hyperedges, closed itemsets are the intents of formal concepts, maximal frequent itemsets are dual to the minimal transversals of the infrequent border, and association rules are hyperarcs of a directed hypergraph. The module mines these patterns and turns them back into hypergraphs that can be analyzed and visualized with the rest of the toolbox.

Eclat and Apriori, closed and maximal itemsets, association rules, ARHP weights, validated hyperedges, lattices, formal concepts.

Functions#

transactions_to_hypergraph(transactions[, ...])

One hyperedge per transaction (repeated transactions stay separate hyperedges).

hypergraph_to_transactions(H)

Hyperedges as transactions.

frequent_itemsets(data[, min_support, ...])

Frequent itemsets of a transaction database or of a hypergraph.

closed_itemsets(itemsets)

Closed itemsets: no proper superset has the same support (Pasquier et al. 1999).

maximal_itemsets(itemsets)

Maximal frequent itemsets: no proper superset is frequent.

association_rules(itemsets[, ...])

Association rules \(A\Rightarrow C\) from a table of frequent itemsets.

itemset_hypergraph(itemsets[, min_size, ...])

Hypergraph whose hyperedges are itemsets (weights: support by default).

rule_hypergraph(rules[, weight])

Directed hypergraph of association rules: tail = antecedent, head = consequent.

arhp_weights(itemsets[, min_size])

Hyperedge weights of association-rule hypergraph partitioning (Han et al. 1997).

validated_hyperedges(H[, alpha, correction])

Statistically validated hyperedges (after Musciotto, Battiston and Mantegna 2021).

inclusion_lattice(sets[, labels, weights])

Hasse diagram of the inclusion order of a family of sets.

formal_concepts(H[, min_extent])

Formal concepts of the incidence relation (Ganter and Wille 1999).