{"id":3772,"date":"2026-09-10T00:00:00","date_gmt":"2026-09-09T22:00:00","guid":{"rendered":"https:\/\/humes.pl\/market-basket-analysis-how-do-association-rules-reveal-which-products-customers-buy-together\/"},"modified":"2026-09-24T15:26:55","modified_gmt":"2026-09-24T13:26:55","slug":"market-basket-analysis-how-do-association-rules-reveal-which-products-customers-buy-together","status":"publish","type":"post","link":"https:\/\/humes.pl\/en\/market-basket-analysis-how-do-association-rules-reveal-which-products-customers-buy-together\/","title":{"rendered":"Market basket analysis: how do association rules reveal which products customers buy together?"},"content":{"rendered":"<p>You have millions of receipts in your database and a question from the management board: which products really sell together, and which only appear related because both are bestsellers? <a href=\"https:\/\/humes.pl\/en\/glossary\/market-basket-analysis\/\">Market basket analysis<\/a> answers this question in the language of three metrics &#8211; support, confidence, and lift &#8211; and their correct interpretation determines whether a result makes it into the planogram or the trash. Below is a practical guide: how to prepare transaction data, generate association rules, and distinguish patterns from noise.<\/p>\n<h2>What is market basket analysis and when is it worth using?<\/h2>\n<p>Market basket analysis is a <strong>data mining<\/strong> technique that uses a set of transactions to identify groups of products that occur together in the same basket. Their relationship beyond independent sales can be assessed using lift, among other metrics. The formal output consists of <strong>association rules<\/strong> expressed as an implication: if product A is in the basket (the antecedent), then product B is also in it with a specified probability (the consequent).<\/p>\n<p>The method does not require a survey, panel, or respondent declarations. It works with traces of actual behavior &#8211; a point-of-sale record, e-commerce order, or mobile app basket. This distinguishes it from declarative research: the customer does not need to remember or explain why they added a second product to their basket. It is enough that they did so, and did so often enough.<\/p>\n<p>Market basket analysis becomes useful in several typical operational situations. Below is a list of contexts in which the research question naturally leads to association rules:<\/p>\n<ul>\n<li><strong>Assortment layout and category adjacency<\/strong> &#8211; when there is a need to determine which product groups actually move through the basket together, rather than merely seeming related at the category level.<\/li>\n<li><strong>Designing <em>cross-selling<\/em> mechanisms<\/strong> &#8211; &#8220;frequently bought together&#8221; recommendations, promotional bundles, and suggestions in the e-commerce basket.<\/li>\n<li><strong>Assessing cannibalization and complementarity<\/strong> &#8211; rules with a lift below one indicate pairs that occur in the same basket less often than would be expected under independence; this may provide grounds for further substitution analysis.<\/li>\n<li><strong>Diagnosing the <a href=\"https:\/\/humes.pl\/en\/glossary\/shopping-mission\/\">shopping mission<\/a><\/strong> &#8211; &#8220;quick replenishment,&#8221; &#8220;large weekly shopping trip,&#8221; and &#8220;consumption occasion&#8221; baskets may have different co-occurrence structures.<\/li>\n<li><strong>Supporting newly introduced categories<\/strong> &#8211; identifying products with which a new item appears in baskets during its first weeks on the shelf.<\/li>\n<\/ul>\n<p><\/br><\/p>\n<p>It is worth noting the boundary of interpretation. Market basket analysis describes <strong>co-occurrence<\/strong>, not causality. The rule &#8220;diapers \u2192 wet wipes&#8221; does not mean that buying diapers causes the purchase of wipes. It may reflect a shared shopping mission, promotion, product display, or other factors. Causal inference requires an experiment &#8211; a test in selected stores, an A\/B test of recommendations, or quasi-experimental analysis with a control group.<\/p>\n<h2>How are support, confidence, and lift calculated in practice?<\/h2>\n<p>The method is built around three metrics. Each answers a different question, and none alone is sufficient to evaluate a rule.<\/p>\n<p><strong>Support<\/strong> is the share of transactions containing a given product set in the total number of transactions. It answers the question: how often does this basket occur at all? Support is a measure of scale. A rule with negligible support, even if it appears statistically impressive, concerns only a handful of receipts and rarely translates into an operational decision to change the product display.<\/p>\n<p><strong>Confidence<\/strong> is the conditional probability: what proportion of baskets containing product A also contain product B? It answers the question: how reliable is the implication? However, confidence has a significant limitation &#8211; it is inflated by the popularity of the consequent. If milk appears in most baskets across the chain, then almost every &#8220;anything \u2192 milk&#8221; rule will have high confidence, even though it provides no information about an above-average relationship.<\/p>\n<p><strong>Lift<\/strong> corrects for this limitation. It is the ratio of the rule&#8217;s confidence to the support of the consequent itself, comparing observed co-occurrence with a situation of complete product independence. A lift equal to one indicates no relationship in the analyzed data. Above one, products occur together more often than would be expected under independence. Below one, they occur together less often, which may signal substitution but may also result from other differences between transactions.<\/p>\n<p>In practice, these three metrics are used sequentially: first, a support filter screens out marginal rules, then confidence and lift rank the remainder. Thresholds should be set before confirmatory analysis or clearly described as exploratory to reduce the risk of fitting criteria to a preconceived hypothesis.<\/p>\n<p>A high lift based on a small number of transactions may result from random fluctuation, so support thresholds should be set before the analysis and results checked against an independent period or sample. A rule with a lift several times greater than one, based on several dozen receipts in a database containing millions, requires particular caution and validation before operational use.<\/p>\n<h3>What steps are involved in preparing transaction data?<\/h3>\n<p>Most of the work involved in market basket analysis lies not in the algorithm but in data preparation. Below is a typical sequence of activities in a project:<\/p>\n<ol>\n<li><strong>Defining the transaction unit.<\/strong> Is a basket a single receipt or the sum of a customer&#8217;s purchases on a given day? In e-commerce, is it an order or a session? The answer changes the structure of the results.<\/li>\n<li><strong>Selecting the product aggregation level.<\/strong> Rules at the SKU level are precise, but they fragment support and generate thousands of relationships that are difficult to interpret. The subcategory or brand level produces more stable rules that are easier to implement.<\/li>\n<li><strong>Cleaning the dataset.<\/strong> Removing returns, point-of-sale corrections, test transactions, business purchases, and non-product items such as fees, packaging, and bags.<\/li>\n<li><strong>Binarizing the basket.<\/strong> Classic association rules operate on product presence, not quantity or value. Quantity is analyzed separately when estimating the rule&#8217;s potential value.<\/li>\n<li><strong>Setting thresholds.<\/strong> Minimum support, minimum confidence, and minimum lift are defined before running confirmatory analysis, with justification based on database size and the purpose of the analysis.<\/li>\n<li><strong>Generating rules.<\/strong> Most often using the Apriori or FP-Growth algorithm, depending on dataset size and the number of unique items.<\/li>\n<li><strong>Temporal validation.<\/strong> Checking whether the rule persists across subsequent time windows or disappeared when the promotion ended.<\/li>\n<\/ol>\n<p><\/br><\/p>\n<p>The final step is often overlooked, yet it accounts for a substantial part of the difference between valuable analysis and a list of curiosities. A rule present in January, February, and March data is a more credible candidate for a stable pattern than one visible only during the week of a promotional flyer. The latter may describe the promotional mechanism rather than lasting purchasing behavior.<\/p>\n<h2>What errors most often distort market basket analysis results?<\/h2>\n<p>Market basket analysis is technically straightforward and therefore prone to overinterpretation. Below are the pitfalls most commonly encountered in projects using transaction data.<\/p>\n<ul>\n<li><strong>Discovering the obvious.<\/strong> The algorithm may indicate that bread is bought with dairy products and shampoo with conditioner. Rules with high support and high confidence may be trivial. Analytical value may begin where lift is clearly elevated at moderate support &#8211; this is the area of non-obvious but sufficiently frequent relationships.<\/li>\n<li><strong>Ignoring the effect of promotions.<\/strong> Co-occurrence caused by a promotional bundle or an endcap display describes the effect of marketing and does not necessarily reflect a lasting customer preference. Without marking promotional periods in the data, rules may become a self-portrait of a company&#8217;s own sales activities.<\/li>\n<li><strong>The multiple testing effect.<\/strong> With several thousand products, the number of possible pairs runs into the millions. Some rules will exceed set thresholds solely due to chance. The response is an appropriate support threshold, validation using an independent time window, and, where necessary, an assessment of statistical uncertainty.<\/li>\n<li><strong>Mixing channels and formats.<\/strong> Baskets in convenience stores, hypermarkets, and online channels follow different logic. Combining them into one dataset may generate averaged rules that are inappropriate for individual formats.<\/li>\n<li><strong>Rule asymmetry.<\/strong> The rule A \u2192 B and the rule B \u2192 A have identical support and lift but different confidence. Overlooking this difference may lead to choosing the wrong direction for a recommendation, although it does not imply a causal direction.<\/li>\n<li><strong>No translation into value.<\/strong> A rule with high lift may concern products with marginal margin or turnover. Assessing a rule&#8217;s usefulness requires combining it with value data, which association metrics alone do not provide.<\/li>\n<\/ul>\n<h3>How does market basket analysis differ from segmentation and declarative research?<\/h3>\n<p>Market basket analysis describes the structure of a single transaction. Customer segmentation describes an individual&#8217;s profile across multiple transactions. These are two different levels of observation and often produce different pictures. The same customer may carry out a &#8220;quick replenishment&#8221; mission on Monday and a &#8220;large shopping trip&#8221; mission on Saturday &#8211; association rules will capture the difference between baskets, while segmentation may assign that customer to one or several profiles, depending on the method used.<\/p>\n<p>Declarative research, in turn, can provide stated explanations of motivations. Market basket analysis shows that two products occur together but does not explain why. Therefore, in mixed-methods projects, association rules serve a hypothesis-generating function: they identify pairs worth exploring further in an interview, shopper research, or a point-of-sale test. The most useful insights may emerge when a quantitative result from transaction data is confronted with an observation of behavior at the shelf.<\/p>\n<p><a href=\"https:\/\/humes.pl\/en\/retail-audit-how-store-level-data-complement-consumer-panel-data\/\">Retail measurement<\/a> provides a complementary perspective by showing product availability and display conditions. Without this layer, it is easy to interpret the absence of a rule as a lack of interest when the cause may simply have been an out-of-stock situation during the analyzed period.<\/p>\n<h2>How can you assess whether a rule is suitable for implementation?<\/h2>\n<p>Not every statistically valid rule is operationally useful. Before submitting results to the sales department, it is worth reviewing the following checklist.<\/p>\n<ul>\n<li><strong>Scale.<\/strong> Does the rule&#8217;s support correspond to a number of transactions at which changing the product display or recommendation has a chance of producing a measurable effect?<\/li>\n<li><strong>Stability.<\/strong> Does the rule persist across at least several independent time windows and, if it is to be implemented widely, across the relevant store formats?<\/li>\n<li><strong>Non-obviousness.<\/strong> Does the rule provide information that simple category knowledge would not?<\/li>\n<li><strong>Directionality.<\/strong> Has confidence been checked in both directions, and has the direction of the recommendation been selected to match the business objective?<\/li>\n<li><strong>Free from promotion effects.<\/strong> Was the analysis period not dominated by bundle mechanics or promotional flyers?<\/li>\n<li><strong>Testability.<\/strong> Can the rule be translated into a hypothesis that can be verified through an experiment in some stores or an A\/B test in the online channel?<\/li>\n<\/ul>\n<p><\/br><\/p>\n<p>The final point is the most important methodologically. Market basket analysis generates hypotheses; only a test provides evidence of implementation effectiveness. Treating a list of rules as a ready-made set of conclusions skips this step and transfers the risk of misinterpretation to implementation.<\/p>\n<h2>Frequently asked questions<\/h2>\n<h3>What is market basket analysis?<\/h3>\n<p>Market basket analysis is a data mining technique that identifies products occurring together in the same basket within a set of transactions. The result consists of association rules in the form &#8220;if A, then probably also B,&#8221; described using support, confidence, and lift metrics. The method works with recorded purchasing behavior rather than declarations and describes co-occurrence, not a causal relationship.<\/p>\n<h3>What do support, confidence, and lift mean?<\/h3>\n<p>Support is the share of transactions containing a given product set in the entire database &#8211; it measures the scale of the phenomenon. Confidence is the conditional probability that the consequent will occur in baskets containing the antecedent &#8211; it measures the strength of the implication, but is inflated by popular products. Lift compares observed co-occurrence with a situation of complete independence: a value above one indicates a positive relationship in the analyzed data, a value equal to one indicates no such relationship, and a value below one indicates a negative relationship, which may, but does not have to, mean substitution.<\/p>\n<h3>What data is needed for market basket analysis?<\/h3>\n<p>The minimum requirement is a transaction identifier and a list of items included in it, with a consistent product dictionary and category hierarchy. Useful additions include the date and time of the transaction, store and format identifiers, promotional period markers, and the value and quantity of items &#8211; these make it possible to account for the effects of sales mechanisms and estimate a rule&#8217;s potential value. A customer identifier from a loyalty program is not required, but it makes it possible to link rules with the buyer&#8217;s profile.<\/p>\n<h2>Ask about market basket analysis using data from your store or chain<\/h2>\n<p>Ask about market basket analysis using data from your store or chain &#8211; Hume&#8217;s Institute will prepare the scope of the analysis, set metric thresholds appropriate to the size of the database, and propose a method for validating the results. <a href=\"https:\/\/humes.pl\/en\/contact\/\">Contact us<\/a> to discuss the structure of your available transaction data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Which products do customers buy together, and is it a coincidence? We explain how to read support, confidence and lift in market basket analysis and when a rule is usable.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[912],"tags":[],"slowa_kluczowe":[],"class_list":["post-3772","post","type-post","status-publish","format-standard","hentry","category-badania-i-analizy"],"acf":[],"_wp_attached_file":null,"_wp_attachment_metadata":null,"wpml_media_processed":null,"_wpml_media_usage_in_posts":null,"_wp_attachment_context":null,"_oembed_35c905c64c03156f243b94f18c4eb80f":null,"_wp_attachment_image_alt":null,"rank_math_description":"Market basket analysis shows which products customers buy together. Learn how to read support, confidence and lift and when a rule is ready to use.","rank_math_focus_keyword":"market basket analysis","rank_math_contentai_score":null,"_wpml_post_translation_editor_native":null,"_menu_item_type":null,"_menu_item_menu_item_parent":null,"_menu_item_object_id":null,"_menu_item_object":null,"_menu_item_target":null,"_menu_item_classes":null,"_menu_item_xfn":null,"_menu_item_url":null,"_wp_page_template":null,"rank_math_og_content_image":null,"_wp_trash_meta_status":null,"_wp_trash_meta_time":null,"_wp_desired_post_slug":null,"rank_math_primary_category":null,"_acf_changed":null,"wp_pattern_sync_status":null,"_form":null,"_mail":null,"_mail_2":null,"_messages":null,"_additional_settings":null,"_locale":null,"_hash":null,"_config_validation":null,"_wp_old_slug":null,"rank_math_internal_links_processed":"1","_top_nav_excluded":null,"_cms_nav_minihome":null,"_thumbnail_id":null,"_last_translation_edit_mode":"native-editor","_wpml_word_count":"2406","_dp_original":null,"_edit_last":null,"_edit_lock":null,"rank_math_seo_score":null,"_wpml_location_migration_done":null,"_wpml_media_duplicate":null,"_wpml_media_featured":null,"_wp_old_date":"2026-09-24","copied_media_ids":[],"referenced_media_ids":[],"rank_math_title":"Market basket analysis explained | Hume's Institute","job_department":null,"_job_department":null,"job_location":null,"_job_location":null,"job_offer_external_link":null,"_job_offer_external_link":null,"footnotes":null,"inline_featured_image":null,"blog_podtytul":null,"_blog_podtytul":null,"blog_czas_czytania":null,"_blog_czas_czytania":null,"blog_dalsza_lektura":null,"_blog_dalsza_lektura":null,"slownik_krotka_definicja":null,"_slownik_krotka_definicja":null,"slownik_cytat":null,"_slownik_cytat":null,"slownik_na_stronie_glownej":"1","_slownik_na_stronie_glownej":null,"slownik_slowa_kluczowe":null,"_slownik_slowa_kluczowe":null,"slownik_w_praktyce":null,"_slownik_w_praktyce":null,"slownik_powiazane":null,"_slownik_powiazane":null,"slownik_kluczowe_punkty":null,"_slownik_kluczowe_punkty":null,"lang":"en","translations":{"en":3772},"pll_sync_post":{},"_links":{"self":[{"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/posts\/3772","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/comments?post=3772"}],"version-history":[{"count":1,"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/posts\/3772\/revisions"}],"predecessor-version":[{"id":3773,"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/posts\/3772\/revisions\/3773"}],"wp:attachment":[{"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/media?parent=3772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/categories?post=3772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/tags?post=3772"},{"taxonomy":"slowa_kluczowe","embeddable":true,"href":"https:\/\/humes.pl\/en\/wp-json\/wp\/v2\/slowa_kluczowe?post=3772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}