Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Manually Calculating Association Rules on Sample Ledgers | Foundations of Association Rules and Transactional Analysis
Market Basket Analysis and Recommendation Systems
Section 1. Chapter 3
single

single

Challenge: Manually Calculating Association Rules on Sample Ledgers

Swipe to show menu

Task

Swipe to start coding

Given a sample transaction ledger, your task is to manually compute support, confidence, and lift for specified item pairs using Python code.

  • Calculate the support of the pair (item_a, item_b) as the proportion of transactions containing both items.
  • Calculate the confidence of the rule item_a → item_b as the proportion of transactions with item_a that also contain item_b.
  • Calculate the lift of the rule as the confidence divided by the support of item_b.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 3
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt