In practice5 min read

What customers buy together: AI-assisted restaurant basket analysis

Find menu pairings in receipts, calculate support, confidence and lift, then test a suggestion while accounting for bundles, refunds and contribution.

Prepared by the NADALI editorial team using AI

AI illustration: restaurant dishes and grouped receipts representing basket analysis.
Концептуальна ШІ-ілюстрація / Conceptual AI illustration: Nadali, OpenAI gpt-image-2, 2026-11-08. Not an event photograph or evidence of testing. · AI-generated for Nadali using its authorized OpenAI server account; no third-party photograph. Use under applicable OpenAI service terms; no exclusive copyright claim. · 1440 × 960

Takeaway. Market-basket analysis identifies dishes that appear in the same order and helps you choose a relevant menu suggestion. High lift gives you a hypothesis to test, not a forecast of extra profit.

Who this is for. Café, restaurant and delivery-business owners with item-level receipt exports who want to assess one recommendation or pairing without a large analytics project.

Start with a decision, not a ranking

Suppose you want to choose a drink, salad or dessert to suggest alongside a main course. A bestseller report cannot answer that question. You need to see what customers already buy together, how often it happens and how many orders could receive the suggestion.

AI can help inspect the file, prepare calculations and explain results. Perform the actual counting with reproducible formulas or code. Persuasive commentary without receipt counts and selection rules is not a sufficient output.

One basket must represent one purchase

Write down the analysis rules first. For an initial pass, you might use four complete weeks with a stable menu. This is an illustrative window, not a guarantee of sufficient data. Record exact dates, timezone, location and sales channel. Check weekday counter sales separately from weekend delivery.

Export order ID, timestamp, location, channel, item code, name, quantity, status, refunds and bundle links. For the financial check, add actual revenue after discounts and variable costs. Remove customer names, phone numbers, addresses and payment details before sharing with AI; check whether your policies permit the service.

Keep the unit of analysis consistent:

  • One purchase paid through two methods remains one basket. Reconstruct split checks only through a reliable order identifier, not nearby timestamps.
  • A duplicate export is not another order. Two portions create one presence flag for that item; retain quantities for the separate financial calculation.
  • Exclude cancellations. Link refunds to the original purchase rather than creating a “negative basket”. For an analysis of purchases after item returns, keep an item only when its net quantity is positive, excluding empty baskets.
  • Distinguish service compensation from a refund of a specific dish. Flag ambiguous cases, report their count and check whether including them changes the conclusion.
  • Initially treat a set meal as its own item. An obligatory bundled drink creates a mechanical association; do not describe it as a freely chosen pairing. Analyse optional additions separately.

These rules describe baskets after returns, not every initial customer intention. Keep that distinction in the conclusion. An absent item also differs from unknown receipt contents: investigate incomplete receipts instead of guessing.

Three measures in an exact example

These data are hypothetical. Among 100 eligible receipts, main course A appears in 40, drink B in 30 and both in 18. Therefore, 22 contain only A, 12 only B and 48 neither of these two items.

  • Support: 18 / 100 = 18%, the share containing both.
  • Confidence for A → B: 18 / 40 = 45%, the share with B among receipts with A.
  • Lift: 0.45 / 0.30 = 1.5. The denominator is B’s share of the same complete sample. See the definitions in the primary association_rules documentation.

In the reverse direction, B → A has confidence of 18 / 30 = 60%, while lift remains 1.5. The arrow does not establish that A was ordered before B.

Under independence, the expected joint share would be 0.40 × 0.30 = 12%, or 12 receipts. Observing 18 means the pair occurs 1.5 times as often as this benchmark. It does not promise a 50% sales increase or identify six extra receipts caused by promotion. No offer has yet changed, and no intervention effect has been measured.

What to ask AI to return

Use a specific brief: “Build baskets and item pairs using the agreed rules. For each pair, show total baskets, counts with A, with B and with both, support, confidence in both directions and lift. Include formulas or code, an exclusion log and anonymised identifiers for spot checks. Do not call associations incremental sales.”

Reconcile eligible-order counts with the source. Manually verify several pairs and their receipts, particularly the most impressive result. High lift based on two joint purchases may be chance; low frequencies make estimates unstable. The methodological review of association measures explains this risk.

Keep absolute joint counts beside every pair. Agree a minimum count before reviewing rankings, without presenting it as universal proof of reliability. Check the shortlist on a different period. Statistical claims across many pairs require consideration of multiple-testing correction.

Review lunch versus dinner, delivery versus dine-in, and promotion versus ordinary days without fragmenting data into tiny groups. Record stockouts: a drink unavailable for a week had fewer opportunities to appear. Even a stable association could reflect customer mix or party size.

Check contribution and test one change

Calculate the add-on’s contribution towards fixed costs. Check ingredient costs and yields. A hypothetical example on a consistent, VAT-exclusive basis: revenue of UAH 90 minus ingredients of UAH 32, packaging of UAH 8 and additional commission of UAH 10 leaves UAH 40. Include other costs that genuinely change with the sale. Discounting an already popular pair can reduce earnings on purchases that would happen anyway.

Choose one suggestion, preferably without a discount initially. Define eligible orders before launch and randomly assign them to the recommendation or the usual experience. NIST explains random assignment of experimental conditions. If assignment must happen by shift or day, the design and analysis must account for that grouping.

Compare contribution per eligible order, including all eligible orders rather than only add-on purchases. Track cancellations, refunds, displacement of other items and service speed. Check test feasibility; set size, duration and decision criteria in advance. “This week versus last week” alone cannot separate the recommendation’s effect from other changes.

Practical conclusion: the first analysis should produce one testable suggestion with visible counts, costs and limitations. When evidence is thin, keep it as a hypothesis.

Author: Nadali. Prepared with AI assistance. Examples are hypothetical; no restaurant results are claimed. Sources checked on 8 November 2026. 

Sources and verification

  1. Association rules: primary mlxtend documentation ↗
    Source checked: 2026-11-08
  2. Michael Hahsler: A Probabilistic Comparison of Commonly Used Interest Measures for Association Rules ↗
    Source checked: 2026-11-08
  3. NIST Engineering Statistics Handbook: Completely randomized designs ↗
    Source checked: 2026-11-08