liveBook · Manning

Lift

As explained in Data Without Labels

Lift is the ratio of an association rule's observed joint occurrence to the joint occurrence expected if its antecedent and consequent were independent.

In market basket analysis, many association rules can be drawn from the same transactions. Lift helps shortlist rules by measuring whether an antecedent and consequent occur together more often than expected if they were independent. section 4.11 section 4.3.1

For a rule A → B, lift is the observed joint occurrence of A and B divided by the joint occurrence expected under independence: support(A and B) / [support(A) × support(B)]. A value above 1 means the pair occurs together more often than that baseline; below 1 means less often. Read lift alongside support and confidence rather than as a replacement for them. section 4.3.1 section 4.11

Five invoices

Milk and eggs occur together in two of five invoices; bread appears in four. Both sides of {milk, eggs} → {bread} occur together in two invoices, so lift is (2/5) / [(2/5) × (4/5)] = 1.25. The pairing is more frequent than the independence baseline, although it occurs in only 40% of invoices. section 4.3.1

Table 4.2 Dataset to understand the concept of support, confidence, lift, and conviction
Invoice Number
Milk
Eggs
Bread
Cheese
1001
1
1
1
0
1002
0
1
1
1
1003
1
1
1
0
1004
0
1
0
1
1005
0
1
1
0

Check the five invoice rows and their 1/0 purchase indicators before calculating each side’s support and the joint support. section 4.3.1

In Python, `apyori.apriori` accepts `min_lift` alongside minimum support, confidence, and rule length. One workflow converts CSV transactions into a list of lists, tries lift 4 without obtaining rules, then uses lift 2 and reports 200 rules. Inspect the returned rules’ support, confidence, and lift before deciding which associations are useful. section 4.4.1

apriori_rules = apriori(all_records, min_support=0.25, min_confidence=0.25,
min_lift=2, min_length=2)
apriori_rules = list(apriori_rules)
print(len(apriori_rules))

Shows the Apriori call with `min_lift=2` and the other rule filters, making the selection settings reproducible. section 4.4.1

How Data Without Labels covers it

How deep it goes
Defines lift as a dependence measure and applies it to transaction counts and an Apriori threshold, without developing statistical theory.
Examples
Uses five milk-and-eggs invoices and a Python retail-transaction workflow that adjusts minimum lift from 4 to 2.
What it assumes
Introduces transaction indicators and support before using lift; the implementation assumes familiarity with Python dataframes and lists.
What you can do after
Apply it via apyori to filter and inspect association rules alongside support and confidence.
How it connects
Relates lift to association rules, support, confidence, conviction, market basket analysis, and Apriori.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.