Omniscope Custom Views › marketbasket

Market Basket

Find out what sells with what. Point it at your order lines and see which products are bought together, how strongly, and in which baskets, with rules your merchandising and marketing teams can act on.

Table Network visokio-agents

Open the demo in Omniscope Download demo.ioz Sample data: baskets.csv Source on GitHub

Items tagged visokio-agents are community examples built by Visokio's agents, to extend Omniscope's core blocks and views with popular, specialist and more unusual use cases, and to show what anyone, people or agents, can build on Omniscope. They are tested by automated tests and were run on a real Omniscope server. They were not reviewed by Omniscope's core team, so they are not on a par with the core blocks and views, which have years of manual, functional and unit tests behind them. About

Find out what sells with what. Point it at your order lines and see which products are bought together, how strongly, and in which baskets, with rules your merchandising and marketing teams can act on.

Live: an illustrative grocery dataset of 6,000 baskets. Red cells are pairs bought together more often than chance. Hover a cell, click an item to focus on its rules, or click a cell or rule to select those baskets.

The problem it solves

Every retailer and distributor has the data to answer "what do customers buy together?": every till receipt and online order is a basket. The answer drives store layout, promotions, bundles, online recommendations and range decisions. But the analysis usually lives in a data science notebook or a separate tool, and the output is a static table of rules that nobody outside the analytics team explores.

The Market Basket view puts it in an Omniscope report. It counts every pair of items across the baskets, compares that with what chance would predict (the lift), clusters items bought together next to each other and lists the strongest rules in plain language. In the illustrative grocery data above, the shopping "missions" stand out as red blocks: pasta night, burgers, Mexican, baby, tea and biscuits, coffee and croissants. Everyday items like milk and bread go with everything, so their lift stays close to 1.

Switch to confidence, the measure for "customers who bought this also bought":

Live: the 15 most frequent items in frequency order, with rules ranked by confidence.

Where it earns its place

The examples below are illustrative.

Business Basket Typical questions
Grocery and convenience retail Till receipt Which items to place or promote together, what to bundle
E-commerce Order Which recommendations to show, which add-ons to suggest
Wholesale and distribution Invoice Which products to cross-sell to which accounts
Financial services Customer Which products customers hold together, the next best offer
Healthcare Episode Which procedures and tests occur together
Field service Repair job Which parts are replaced together, what to stock in the van

How to use it in Omniscope

  1. Bring your order lines into a workflow (database, files or an API) with one row per item per basket.
  2. Connect it to a Report block, add a view and choose Market Basket.
  3. Set Baskets to the order or transaction ID and Items to the product; optionally set Item colour to a department or category.
  4. Adjust Items shown and Minimum support % to the size of your range and data.
  5. Click a cell or a rule to select those baskets; other views in the report show which stores, days or customers they came from.

Why do this in Omniscope

Data and options

Order lines: a basket ID and an item per row.

Option What it does
Baskets, Items The basket ID and item fields
Item colour Optional category to colour items by
Rank rules by Lift, confidence or support
Order items Clustered by affinity, or most frequent first
Items shown Number of most frequent items in the matrix
Minimum support % Minimum share of baskets for a pair to count
Lines used Maximum lines fetched

Tested with about 370,000 lines from 80,000 baskets and 2,000 distinct items.

Tested

Selecting a pair selects the baskets that contain both
Selecting a pair selects the baskets that contain both
Running on the Omniscope server
Running on the Omniscope server

Reference

Fields it reads

NameTypeWhat it does
BasketsFIELDIdentifier of each basket, e.g. Transaction ID, Order ID, Invoice number
ItemsFIELDWhat was bought, e.g. Product, SKU, Category
Item colourFIELDOptional: colour items by a category, e.g. Department

Options

NameTypeWhat it does
Rank rules byCHOICEOrder of the rules list
Order itemsCHOICEClustering places items bought together next to each other
Items shownNUMBERNumber of most frequent items in the matrix (default 25)
Minimum support %NUMBERPairs must appear in at least this percentage of baskets to count as a rule (default 0.5)
Lines usedNUMBERMaximum number of basket lines fetched (default 300,000)

Third-party libraries