Back to selected work
03 / Data & decision systemsInteractive explainer

What belongs in the same basket?

Two things appear in the same basket. Is that useful, or just common? Explore the difference with a small, transparent dataset.

ORIGINEducational association-rule project
THIS VERSIONProject exploration · synthetic-data reference
TOPICSPython · pandas · Association rules
BASKET LAB / SYNTHETIC DATA

It starts with a basket.

Choose a few items and see how their associations change.

Your basket

12 synthetic transactions · 6 products

OBSERVED ASSOCIATIONS

Milk

5/6 baskets
Support41.7%
Confidence83.3%
Lift1.43×

Bread

3/6 baskets
Support25.0%
Confidence50.0%
Lift0.75×

Apples

1/6 baskets
Support8.3%
Confidence16.7%
Lift0.67×

Sorted by lift. A lift above 1 means co-occurrence is more frequent than expected under independence; it does not establish causation.

Support

Baskets containing the combination ÷ all baskets.

Confidence

Baskets containing the combination ÷ baskets containing your selection.

Lift

Confidence ÷ overall frequency of the suggested item.

Reference demo created for this portfolio. Every metric is calculated from the 12 synthetic transactions above. The original project’s rule engine still needs to be corrected and integrated.

01

The problem

Finding items that appear together can help describe shopping behavior. But a common item will co-occur with many others even without a strong association. Support, confidence, and lift answer different questions; each needs a denominator and enough data to be interpreted responsibly.

02

How it works

The demo uses 12 fixed, synthetic transactions and 6 products. Your selected items form the antecedent. For every remaining item, the browser counts antecedent baskets, item baskets, and joint baskets, then computes support, confidence, and lift. Results are ranked by lift. The full dataset is available in the demo.

01Transactions
02Selected basket
03Exact co-counts
04Rules + metrics
03

Implementation & ownership

The browser calculator and its synthetic dataset were created for this portfolio. It enumerates the available single-item consequents directly rather than running the original mining implementation. The original project’s rule-generation code has not been supplied and still requires the correction identified in the design brief.

04

Decisions & tradeoffs

Exact counting is transparent and appropriate for a tiny demonstration. It does not scale into a production recommendation service. Lift can look large when counts are small, and an association is not evidence that recommending an item changes behavior. The interface shows transaction counts alongside the three metrics.

05

Evaluation & next steps

The reference calculator is checked against hand-counted cases and empty or unsupported baskets. Before presenting the original project as complete, correct and test its rule generation, document the real dataset’s provenance and transaction counts, choose minimum support and confidence thresholds, and inspect the stability and usefulness of the resulting rules.

06

Sources & reproduction

Select Coffee to start, inspect the Milk association, and verify its values against the 12 visible transactions. Every displayed metric is calculated locally from that dataset. The original dataset and repository remain unconnected. No real customer data or business impact is claimed.

ABOUT THIS VERSION

The original notebooks, trained models, and evaluation artifacts were not included with the design brief. This page separates a working browser explainer from results that still need to be connected.

Next project / 01

Teaching a taxi to find its way.

LET’S CONNECT

Have somethingin mind?

For software development, applied AI, or a conversation about the work — my inbox is open.