<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Centenoaidan on Medium]]></title>
        <description><![CDATA[Stories by Centenoaidan on Medium]]></description>
        <link>https://medium.com/@centenoaidan060803?source=rss-5036522b8afc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qTd91TnngzW4m9og</url>
            <title>Stories by Centenoaidan on Medium</title>
            <link>https://medium.com/@centenoaidan060803?source=rss-5036522b8afc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 14:20:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@centenoaidan060803/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Exploring Data: Statistics, Visualisation and OLAP]]></title>
            <link>https://medium.com/@centenoaidan060803/exploring-data-statistics-visualisation-and-olap-37f299672184?source=rss-5036522b8afc------2</link>
            <guid isPermaLink="false">https://medium.com/p/37f299672184</guid>
            <category><![CDATA[olap]]></category>
            <category><![CDATA[explore]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Centenoaidan]]></dc:creator>
            <pubDate>Tue, 03 Nov 2026 03:03:54 GMT</pubDate>
            <atom:updated>2026-11-03T03:16:15.552Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t0u6Yj2TUh0d9NSHvP1Rpw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FIUj73KGnQxo7NtXrcn-Ag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ls99xfwRQu0L6-TFcHi-aQ.png" /></figure><p>Exploratory data analysis is the initial, hands-on phase where you get familiar with a dataset. Through basic statistics and visual plots, analysts can uncover patterns, identify data hygiene issues, and narrow down the scope of their inquiry. The workflow relies on a continuous loop: summarize, visualize, and re-evaluate. This step is vital in any data project because algorithms evaluate whatever they are given without questioning quality. Unnoticed anomalies, repeated attributes, or dirty data will quietly distort your downstream results. A few minutes of upfront data exploration acts as an insurance policy for the rest of your analytical pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vnskqb_q4bXrxFh0Kb0kDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bBKRJWzk6rFALq6kh1XIgw.png" /></figure><p>When looking at a set of data, the mean and median react very differently to extreme numbers. If you take a basic dataset of eight numbers ranging between 47,000 and 61,000, both the mean (53,000) and the median (52,500) sit comfortably close to each other. But if you throw in a massive outlier like 2.4 million, the mean gets heavily dragged up by that huge sum, skyrocketing nearly sixfold to 313,778. Meanwhile, the median only nudges up slightly to 53,000 because it simply looks at the middle position rather than the actual magnitude of the numbers. This is why you always need to watch out for skewed values in data analysis — relying solely on the mean can give a completely distorted picture of what a typical number actually looks like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cp0xen_N8PDrQt3KKT41Bg.png" /></figure><p>When figuring out how spread out your data is, you have to choose your metrics wisely depending on whether you have extreme values. Standard tools like the range, variance, and standard deviation easily get thrown off by outliers because they either look at the absolute edges or square the distances. If your data has weird skews, robust options like the interquartile range (IQR) or median absolute deviation (MAD) are much safer bets because they focus on the middle 50% or measure deviations straight from the median. To capture both the center and the spread without assuming a specific shape for your data, analysts rely on the five-number summary (minimum, first quartile, median, third quartile, and maximum), which is what builds box plots. Finally, always stick to the golden pairing rules: pair the mean with the standard deviation, and the median with the IQR or MAD, because sharing a center statistic without its matching spread only gives you half the story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PSSwwjv8pxwR2J-vUXFi7A.png" /></figure><p>When evaluating data spread, the choice between classical and robust metrics becomes critical in the presence of outliers, as extreme values distort measures of dispersion just as severely as they distort central tendency. For example, adding just one extreme outlier can cause the standard deviation to skyrocket by a massive factor of 162 because classical formulas square those large deviations. In contrast, robust options like the interquartile range (IQR) and median absolute deviation (MAD) stay remarkably steady with barely any change. This proves that while a single bad data point can completely rewrite the story told by the mean and standard deviation, the robust combo of the median alongside the IQR or MAD keeps giving you an accurate picture of ordinary data. In the end, picking your spread metrics carefully is just as important as choosing your center metrics if you want your analysis to highlight real patterns instead of noise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8WY8YoLIrcuO1SK-2lF6-A.png" /></figure><p>Box plots and Tukey’s fences give you a visual way to spot outliers using math built on the interquartile range (IQR). The main box covers the middle 50% of your data (from the first to the third quartile), while the whiskers stretch out to the furthest data points that still fall within the calculated fences. Those fences are set by going 1.5 times the IQR outward from the quartiles, creating a lower fence of 38,000 and an upper fence of 70,000 in this dataset. Any number past those lines — like our huge 2,400,000 outlier — gets flagged as a candidate to investigate rather than automatically delete. Just remember that different software programs can sometimes use slightly different formulas to calculate exact quartiles, so your numbers might shift a tiny bit depending on the tool you use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s_8lvfkwfzRLwpTDWOYLgg.png" /></figure><p>Choosing the right statistical measure really comes down to your specific use case and whether your data has any weird skews or outliers. For instance, in fields like real estate or salary reporting where a few massive numbers can throw everything off, you should stick to the median and interquartile range and steer clear of the mean. On the flip side, clean datasets without extremes — like standard reaction times — work wonderfully with the mean and standard deviation. Other situations call for specialized tools, like using percentiles for pediatric growth charts, medians or modes for customer satisfaction scales, or treating viral traffic spikes separately from your everyday baseline. At the end of the day, since any summary sacrifices some detail, professional analysts always back up their numbers with clear visuals, transparently report their methods, and keep checking back as new data rolls in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IsNEnLEteA7XupM0RJlvNA.png" /></figure><p>Picking the right visualization completely depends on what you’re trying to find out, since every chart type highlights certain structural insights while hiding others. For example, histograms are great for showing the shape, distribution, and skew of a single numeric column, though they can change depending on how you choose your bins. Box plots excel at showing the five-number summary and spotting outliers across different groups, but they can completely mask underlying bimodal shapes. If you want to explore relationships between two numbers, scatter plots reveal trends and clusters, and scatter-plot matrices can scale this up to multiple pairs — though they get messy if you push past about eight attributes. Meanwhile, bar charts are ideal for comparing category sizes, even though they hide the internal distribution inside each bar. Ultimately, the golden rule is to match your chart to your data type: use bar charts for categorical (nominal or ordinal) data, and histograms or box plots for continuous (interval or ratio) data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQ-MRwGPcnRIdClbQV9Z7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T0PeYL-GPdwWsBCITXxbiQ.png" /></figure><p>Online Analytical Processing (OLAP) structures data into multi-dimensional cubes to facilitate rapid historical exploration and summary, contrasting sharply with Online Transaction Processing (OLTP) systems designed to record daily operations row by row. At the heart of OLAP are dimensions — such as product, region, and time — which provide analytical perspectives broken down into hierarchical levels like days, months, quarters, and years. These dimensions intersect with measures, which are the numeric facts like revenue, units sold, or cost that get summed, counted, or averaged. While real-world data cubes often scale to five to ten dimensions to query millions of aggregated records, operational systems focus on quickly inserting or updating individual orders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oU4doT-6Xx2GLNMrVfnm-A.png" /></figure><p>Concept hierarchies help organize your data dimensions into different levels of detail — allowing you to zoom out from days to months, quarters, and years, or from individual cities to regions and countries. By navigating these layers, analysts can perform <strong>roll-up</strong> operations to get broader summaries or <strong>drill-down</strong> operations to inspect finer details, meaning you can look at the exact same measure from any perspective you need. When you combine multiple dimensions, like Product, Region, and Time, all of those possible aggregation combinations form a structured cuboid lattice. For instance, just three dimensions create 2³ = 8 unique cuboids, stretching all the way from the fully detailed base data down to the apex representing the grand total.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HedDC11MNsnhfS_gTNXckA.png" /></figure><p>Multi-dimensional data cubes come equipped with powerful operations that make navigating your data’s scope and detail a breeze. When you want to zoom out, a <strong>roll-up</strong> aggregates your data from fine details into broader summaries, like moving from daily stats to monthly totals or cities to countries. On the flip side, a <strong>drill-down</strong> does the exact opposite, breaking a high-level summary (like a national total) back down into specific city-level metrics. If you need to isolate a single viewpoint, a <strong>slice</strong> operation locks one dimension down to a fixed value — such as focusing strictly on 2026 Q1. For more targeted, multi-variable filtering, a <strong>dice</strong> operation restricts several dimensions at the same time, letting you carve out precise combinations across products, regions, and months.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fjUB2ee10MrkSwZkasDfUQ.png" /></figure><p>Practical examples of OLAP roll-up operations show just how easily you can turn messy, granular transaction tables into clear, high-level regional insights. By collapsing away specific product lines and monthly details, you can sum up individual sales to see that the North region brought in 426,000 NT dollars while the South generated 345,000 NT dollars, giving you a combined total of 771,000 NT dollars. This kind of aggregation takes day-to-day operational records and transforms them into clean, structured metrics that leadership can actually use for strategic business planning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6Mzw8jwEziZDHmSrBGpKQ.png" /></figure><p>Practical examples of slicing and dicing show just how easy it is to carve out exact subsets of your data cube. A <strong>slice</strong> operation locks down a single dimension to a specific target — like filtering strictly for January transactions to land on a total revenue of 295,000. A <strong>dice</strong> operation takes it a step further by filtering across multiple dimensions at once, such as isolating shoe sales in the northern region to find a total revenue of 255,000. If you expand those parameters into a broader dice — say, looking at shoes across both the northern and southern regions during January or February — you pull four matching rows that combine for a total revenue of 438,000.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oM8bj2wDeXgilsU01SZ67g.png" /></figure><p>Combining drill-down views with pivot operations gives analysts a powerful way to restructure data and uncover hidden behavioral patterns across multiple attributes like region, month, and product. For instance, if you pivot regional revenue by product type, clear market preferences immediately come to light: while the North region shows a fairly balanced split between bag and shoe sales, the South relies much more heavily on shoes, with bag sales reaching just 60,000. By shifting the visual layout while diving deeper into the numbers, these advanced techniques make it easy to spot distinct regional trends that standard summaries might completely miss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dsF48YFD_AabH7Up4Sfzaw.png" /></figure><p>References</p><p>Anscombe, F. J. (1973). Graphs in statistical analysis. The American Statistician, 27(1), 17–21. <a href="https://doi.org/10.1080/00031305.1973.10478966">https://doi.org/10.1080/00031305.1973.10478966</a></p><p>Chaudhuri, S., &amp; Dayal, U. (1997). An overview of data warehousing and OLAP technology. ACM SIGMOD Record, 26(1), 65–74. <a href="https://doi.org/10.1145/248603.248616">https://doi.org/10.1145/248603.248616</a></p><p>Cleveland, W. S., &amp; McGill, R. (1984). Graphical perception: Theory, experimentation, and application to the development of graphical methods. Journal of the American Statistical Association, 79(387), 531–554. <a href="https://doi.org/10.1080/01621459.1984.10478080">https://doi.org/10.1080/01621459.1984.10478080</a></p><p>Codd, E. F., Codd, S. B., &amp; Salley, C. T. (1993). Providing OLAP (on-line analytical processing) to user-analysts: An IT mandate. Codd &amp; Date.</p><p>Freedman, D., &amp; Diaconis, P. (1981). On the histogram as a density estimator: L2 theory. Zeitschrift für Wahrscheinlichkeitstheorie und Verwandte Gebiete, 57(4), 453–476. <a href="https://doi.org/10.1007/BF01025868">https://doi.org/10.1007/BF01025868</a></p><p>Gray, J., Chaudhuri, S., Bosworth, A., Layman, A., Reichart, D., Venkatrao, M., Pellow, F., &amp; Pirahesh, H. (1997). Data cube: A relational aggregation operator generalizing group-by, cross-tab, and sub-totals. Data Mining and Knowledge Discovery, 1(1), 29–53. <a href="https://doi.org/10.1023/A:1009726021843">https://doi.org/10.1023/A:1009726021843</a></p><p>Han, J., Pei, J., &amp; Tong, H. (2022). Data mining: Concepts and techniques (4th ed.). Morgan Kaufmann.</p><p>Huber, P. J. (1981). Robust statistics. John Wiley &amp; Sons.</p><p>Huff, D. (1954). How to lie with statistics. W. W. Norton.</p><p>Kimball, R., &amp; Ross, M. (2013). The data warehouse toolkit: The definitive guide to dimensional modeling (3rd ed.). Wiley.</p><p>Leys, C., Ley, C., Klein, O., Bernard, P., &amp; Licata, L. (2013). Detecting outliers: Do not use standard deviation around the mean, use absolute deviation around the median. Journal of Experimental Social Psychology, 49(4), 764–766. <a href="https://doi.org/10.1016/j.jesp.2013.03.013">https://doi.org/10.1016/j.jesp.2013.03.013</a></p><p>McKinney, W. (2022). Python for data analysis (3rd ed.). O’Reilly Media.</p><p>Rousseeuw, P. J., &amp; Croux, C. (1993). Alternatives to the median absolute deviation. Journal of the American Statistical Association, 88(424), 1273–1283. <a href="https://doi.org/10.1080/01621459.1993.10476408">https://doi.org/10.1080/01621459.1993.10476408</a></p><p>Sturges, H. A. (1926). The choice of a class interval. Journal of the American Statistical Association, 21(153), 65–66. <a href="https://doi.org/10.1080/01621459.1926.10502161">https://doi.org/10.1080/01621459.1926.10502161</a></p><p>Tan, P.-N., Steinbach, M., Karpatne, A., &amp; Kumar, V. (2019). Introduction to data mining (2nd ed.). Pearson.</p><p>Tufte, E. R. (2001). The visual display of quantitative information (2nd ed.). Graphics Press.</p><p>Tukey, J. W. (1977). Exploratory data analysis. Addison-Wesley.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37f299672184" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Associaton Analysis: From Binary Tables to the Apriori Algorithm]]></title>
            <link>https://medium.com/@centenoaidan060803/associaton-analysis-from-binary-tables-to-the-apriori-algorithm-4aaa384cc093?source=rss-5036522b8afc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4aaa384cc093</guid>
            <category><![CDATA[association]]></category>
            <category><![CDATA[analysis]]></category>
            <category><![CDATA[apriori]]></category>
            <category><![CDATA[item]]></category>
            <category><![CDATA[lift]]></category>
            <dc:creator><![CDATA[Centenoaidan]]></dc:creator>
            <pubDate>Tue, 03 Nov 2026 02:36:26 GMT</pubDate>
            <atom:updated>2026-11-03T03:23:40.507Z</atom:updated>
            <content:encoded><![CDATA[<p>A step-by-step breakdown of how transaction data is evaluated, pruned, and transformed into actionable rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jE4oN57xNTBi0-R5LJlAkQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTZvYANFTUWARDXXmh4FUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UUi3awNP0D_Pn_oX0QXY7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gjf02jkU39g2hNVGqO-3Iw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pulv6P6w9eRrXWb8S02s0Q.png" /></figure><p>Before running market basket analysis or finding association rules, raw receipts need to be turned into a clean, organized table. As shown in the “From Receipts to a Binary Table” slide, each row stands for a transaction (T1 through T10) and each column represents a specific product (like Coffee, Muffin, Sandwich, Juice, or Salad). Instead of tracking complicated details like item counts, prices, or order, the table uses a simple binary system: a 1 means the item was bought, and a 0 means it wasn&#39;t. This makes counting frequencies straightforward—showing that Coffee appears in 7 transactions and Muffins in 6—which sets up a solid, streamlined foundation for checking item co-occurrence and calculating support.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZfmWr3S1q9yK-jEJ-8bS_A.png" /></figure><p>In Association Rule Mining, building effective analytical models requires understanding how itemsets form directional rules. A collection containing k items is known as a k-itemset, such as {Coffee, Muffin} forming a 2-itemset or {Coffee, Muffin, Sandwich} forming a 3-itemset. An association rule connects these itemsets in an “IF-THEN” structure (X -&gt; Y), where antecedent X and consequent Y are disjoint sets, such as {Sandwich, Coffee} implying {Muffin}. Order matters in these conditions, meaning the rule X -&gt; Y is distinct from Y -&gt; X. Crucially, the implying arrow records statistical co-occurrence rather than direct causation, indicating how items appear together in baskets rather than proving that buying X explicitly causes a customer to purchase Y.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WNQpjKFfj-O7e72RURRJcw.png" /></figure><p>As demonstrated, single items are evaluated across 10 sample baskets — showing Coffee appearing with the highest support at 0.70, down to Salad at 0.30. The metric extends seamlessly to itemsets, such as {Coffee}, {Muffin} appearing in 6 out of 10 baskets {support} = 0.60), and {Coffee},{Muffin}, {Sandwich} appearing in 3 baskets {support} = 0.30. Ultimately, support is crucial because it filters out random coincidences and uninteresting rules, ensuring that downstream algorithms like Apriori only focus on relationships anchored by statistically significant purchasing volume.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BLRk5FcU6Aw_3fu_SIeTdQ.png" /></figure><p>While support measures how frequently items appear together, confidence evaluates the reliability or strength of an association rule by calculating the conditional probability of buying item Y given that item X is already in the basket. Defined as confidence(X -&gt; Y) = support(X U Y) / support(X), this metric estimates P(Y | X) and is strictly directional, meaning that rule X -&gt; Y is not equal to rule Y -&gt; X. Examining the same pair of items yields different confidence scores due to changing denominators: Muffin -&gt; Coffee achieves a confidence of 1.00 (0.60 / 0.60) because every transaction containing a muffin also includes a coffee, whereas Coffee -&gt; Muffin drops to 0.86 (0.60 / 0.70) because coffee is bought more frequently overall. Comparing other café rules shows Sandwich -&gt; Coffee at 0.80 and Sandwich -&gt; Muffin at 0.60, demonstrating how confidence helps marketers and data analysts determine how predictably one purchase leads to another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YUIjoG6CKWHLj-ofCwGPnA.png" /></figure><p>While confidence shows rule reliability, <strong>lift</strong> measures whether items are truly associated or if their co-occurrence is merely a coincidence driven by high individual item popularity. Calculated as lift(X -&gt; Y) = confidence(X -&gt; Y) / support(Y) or support(X U Y) / (support(X) * support(Y)), lift controls for baseline probabilities to determine if items are bought together more often than expected by random chance. A lift value greater than 1 indicates a strong positive association (items are bought together more than chance), equal to 1 implies independence, and less than 1 reveals a negative association (items avoid each other). The rule Salad -&gt; Juice yields a high lift of 2.50 (1.00 / 0.40), highlighting a powerful positive link. Conversely, Sandwich -&gt; Muffin results in a lift of 1.00 (0.60 / 0.60), proving those items are independent despite having a seemingly high 60% confidence score, while Coffee -&gt; Juice drops to a lift of 0.36 (0.143 / 0.40), exposing a true negative association.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7t97Z-tPJECw4fGttlKreQ.png" /></figure><p>To synthesize all three metrics, evaluating association rules side by side provides a complete picture of product relationships by balancing frequency, directional probability, and true statistical correlation. Comparing rules across support, confidence, and lift highlights two essential insights. First, lift is symmetric while confidence is not — for instance, Muffin -&gt; Coffee and Coffee -&gt; Muffin share the same support (0.60) and positive lift (1.43), yet differ in confidence (1.00 vs. 0.86) due to varying baseline item frequencies. Similarly, Salad -&gt; Juice and Juice -&gt; Salad both demonstrate a strong positive lift of 2.50, but feature different confidence scores (1.00 vs. 0.75). Second, a rule can display high confidence purely because the target item is globally popular, as seen with Sandwich -&gt; Coffee (confidence 0.80, lift 1.14) and Sandwich -&gt; Muffin (confidence 0.60, lift 1.00, indicating complete independence). Conversely, Coffee -&gt; Juice yields a lift of only 0.36, confirming a clear negative association where customers actively avoid buying the two together. Ultimately, high confidence paired with a lift near 1 simply signals a popular product rather than a meaningful cross-selling link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pUdCMYBd9sFGE6RWKIIiYw.png" /></figure><p>While standard metrics like support, confidence, and lift provide a strong foundation for association rule mining, advanced evaluation often requires looking at <strong>leverage</strong> and <strong>conviction</strong> to gain deeper insights into item relationships. Support filters out rare coincidences, confidence estimates rule reliability, and lift measures strength relative to chance (with a neutral value of 1). Moving beyond lift, leverage measures the absolute difference between the observed co-occurrence frequency and expected co-occurrence under independence; for instance, the rule Sandwich -&gt; Coffee achieves a leverage of 0.40 — (0.50 * 0.70) = 0.05, demonstrating that 5% of all baskets contain this combination beyond what chance alone would predict. Meanwhile, conviction measures the directional dependency of a rule by comparing how often X occurs without Y against expected independence; for Sandwich -&gt; Coffee, the conviction of (1–0.70) / (1–0.80) = 1.5 indicates that if Sandwich and Coffee were truly independent, the rule would be incorrect 1.5 times as often. Together, leverage and conviction refine association evaluation by isolating true incremental impact and measuring directional error rates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KFA3OC0HYa48a20zCyFo-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8lSUnNo_AK9KablURIog9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C6vdZJQcJXvgamz73g3csw.png" /></figure><p>To efficiently mine association rules from transactional datasets, algorithms typically employ a structured two-stage strategy. As illustrated in the slide titled “A Two-Stage Strategy,” the workflow begins with raw transactions consisting of multiple baskets and items, moving first into Stage 1 to identify frequent itemsets by retaining only those that meet or exceed a user-defined minimum support threshold (minsup). This initial stage is computationally heavy and dominates the process because candidate counting is where the combinatorial explosion occurs. Stage 2 then handles rule generation by splitting the frequent itemsets and keeping rules that satisfy a minimum confidence threshold (minconf), which is much faster since all rules originating from the same itemset share its support and require checking it only once. Ultimately, this process yields a final set of rules ranked by lift, governed by two user-defined thresholds where minsup prunes itemsets and minconf prunes rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U1cKc2OlW7ZR81AUWVl5Yw.png" /></figure><p>To solve the computational bottleneck of searching through massive combinations of items, the Apriori algorithm relies on a logical shortcut known as the Apriori principle, which states that a whole is never more common than its parts. As illustrated in the slide titled The Apriori Principle, given a minimum support threshold of 3 out of 10 baskets, the lattice structure maps relationships from single items up to larger itemsets. By using this rule, any subset of a frequent itemset must also be frequent, and conversely, any superset containing an infrequent subset can be safely pruned without ever scanning the transaction data. For instance, once pairs like CJ, MJ, and SJ are identified as infrequent, higher-level combinations branching from them are immediately pruned and never counted, transforming an otherwise explosive combinatorial search into a manageable and efficient process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3AbuORXXw5h57NW1x2fxrQ.png" /></figure><p>To execute the itemset discovery process efficiently, the Apriori algorithm follows a systematic five-step iterative loop as outlined in the slide titled The Apriori Loop, Step by Step. The process begins in step one by counting individual items and keeping those that meet the minimum support threshold, followed in step two by joining pairs from the previous frequent set to form new candidate itemsets using a shared prefix to prevent duplicates. Step three prunes away candidates containing infrequent subsets, while step four scans the transaction baskets to count the remaining survivors. Finally, step five filters these counts to retain the frequent itemsets for that level, stopping if the result is empty or incrementing k to repeat the loop, ensuring that the algorithm performs only one data scan per level</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XM0lgxl8L4z_5oxjIMSWjw.png" /></figure><p>The first pass of the Apriori algorithm evaluates individual items to determine which ones meet the minimum support threshold required for further analysis. Every item with a support value greater than or equal to minsup survives into the initial frequent 1-itemset (F1), keeping in mind the rule of thumb that the exact threshold value itself counts as frequent. When evaluating items across ten transactions — such as Coffee (0.70), Muffin (0.60), Sandwich (0.50), Juice (0.40), and Salad (0.30) — all five items qualify if minsup is set to 0.30, generating 10 potential candidate pairs (5 choose 2) for the next stage. However, raising minsup to 0.40 drops Salad, immediately eliminating four potential pairs before they are ever counted and significantly reducing downstream computational effort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*huP4snIB1kHIt66jyBGxDw.png" /></figure><p>During the second pass of the mining process, candidate pairs of items are evaluated against the minimum support threshold to generate the frequent 2-itemset. Pairs meeting or exceeding the threshold are retained, such as coffee and muffin with a support of 0.60, coffee and sandwich at 0.40, and muffin and sandwich alongside juice and salad at 0.30. Conversely, pairs failing to reach the required support level are dropped, revealing underlying customer behavior patterns. For instance, nearly all juice combinations appear in only a single basket, indicating that juice drinkers form a distinct and separate consumer group compared to the core bakery shoppers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0mRgEddv9QXDkiJ8PTl5Kw.png" /></figure><p>Once frequent itemsets are identified, the next stage is generating association rules by splitting the itemsets into antecedents and consequents. A k-itemset produces 2^k — 2 candidate rules, meaning a 3-itemset like {Coffee, Muffin, Sandwich} yields 6 possible rules to test. Applying a minimum confidence threshold (such as 0.70) prunes weaker predictions. For instance, rules like Muffin, Sandwich -&gt; Coffee (confidence 1.00, lift 1.43) and Coffee, Sandwich -&gt; Muffin (confidence 0.75, lift 1.25) meet the standard and are kept, while rules with broader consequents fall below the threshold and are dropped. This filtering relies on rule-level pruning: moving items from the antecedent into the consequent can only decrease a rule’s confidence score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gp6MY5LjVXexvPNXK07MqA.png" /></figure><p>While the Apriori algorithm provides a simple and intuitive foundation using level-wise candidate generation and anti-monotone subset pruning, it suffers from requiring multiple database scans and large candidate sets at low minimum support thresholds. To overcome these computational bottlenecks, alternative algorithms like FP-Growth and Eclat offer powerful search improvements while ultimately returning the exact same frequent itemsets. FP-Growth compresses transactional data into a compact FP-tree structure, enabling frequent itemset mining entirely without candidate generation through just two database scans, though the resulting tree can become large and complex to implement. Meanwhile, Eclat takes a vertical layout approach by intersecting transaction-id lists to perform rapid support counting via fast set intersections, making it highly efficient unless the dataset is dense enough to cause transaction ID lists to grow excessively large.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YeWnOqHCB35TWm1n0fBQDg.png" /></figure><p>Association analysis transforms basic transactional counting into actionable evidence when evaluation metrics are interpreted with care. The core process relies on support to filter out random coincidences, confidence to gauge rule reliability, and lift to test associations against chance. To keep the computational workload manageable, the Apriori principle prunes the search lattice so that candidate mining can finish efficiently. Analysts must judge these findings by checking lift, setting thresholds deliberately, and treating the resulting rules as testable hypotheses. Looking ahead, the analytical framework transitions from simple association toward proving actual effects using sequential patterns and A/B testing.</p><p>References</p><p>Agrawal, R., Imieliński, T., &amp; Swami, A. (1993). Mining association rules between sets of items in large databases. In <em>Proceedings of the 1993 ACM SIGMOD International Conference on Management of Data</em> (pp. 207–216). ACM. <a href="https://doi.org/10.1145/170035.170072">https://doi.org/10.1145/170035.170072</a></p><p>Agrawal, R., &amp; Srikant, R. (1994). Fast algorithms for mining association rules in large databases. In <em>Proceedings of the 20th International Conference on Very Large Data Bases</em> (pp. 487–499). Morgan Kaufmann.</p><p>Brin, S., Motwani, R., Ullman, J. D., &amp; Tsur, S. (1997). Dynamic itemset counting and implication rules for market basket data. <em>ACM SIGMOD Record, 26</em>(2), 255–264. <a href="https://doi.org/10.1145/253262.253325">https://doi.org/10.1145/253262.253325</a></p><p>Hahsler, M., Grün, B., &amp; Hornik, K. (2005). arules: A computational environment for mining association rules and frequent item sets. <em>Journal of Statistical Software, 14</em>(15), 1–25. <a href="https://doi.org/10.18637/jss.v014.i15">https://doi.org/10.18637/jss.v014.i15</a></p><p>Han, J., Pei, J., &amp; Tong, H. (2022). <em>Data mining: Concepts and techniques</em> (4th ed.). Morgan Kaufmann.</p><p>Han, J., Pei, J., &amp; Yin, Y. (2000). Mining frequent patterns without candidate generation. <em>ACM SIGMOD Record, 29</em>(2), 1–12. <a href="https://doi.org/10.1145/335191.335372">https://doi.org/10.1145/335191.335372</a></p><p>Linden, G., Smith, B., &amp; York, J. (2003). Amazon.com recommendations: Item-to-item collaborative filtering. <em>IEEE Internet Computing, 7</em>(1), 76–80. <a href="https://doi.org/10.1109/MIC.2003.1167344">https://doi.org/10.1109/MIC.2003.1167344</a></p><p>Piatetsky-Shapiro, G. (1991). Discovery, analysis, and presentation of strong rules. In G. Piatetsky-Shapiro &amp; W. J. Frawley (Eds.), <em>Knowledge discovery in databases</em> (pp. 229–248). AAAI Press/MIT Press.</p><p>Raschka, S. (2018). MLxtend: Providing machine learning and data science utilities and extensions to Python’s scientific computing stack. <em>Journal of Open Source Software, 3</em>(24), 638. <a href="https://doi.org/10.21105/joss.00638">https://doi.org/10.21105/joss.00638</a></p><p>Srivastava, J., Cooley, R., Deshpande, M., &amp; Tan, P.-N. (2000). Web usage mining: Discovery and applications of usage patterns from web data. <em>ACM SIGKDD Explorations Newsletter, 1</em>(2), 12–23. <a href="https://doi.org/10.1145/846183.846188">https://doi.org/10.1145/846183.846188</a></p><p>Tan, P.-N., Kumar, V., &amp; Srivastava, J. (2004). Selecting the right objective measure for association analysis. <em>Information Systems, 29</em>(4), 293–313. <a href="https://doi.org/10.1016/S0306-4379(03)00072-3">https://doi.org/10.1016/S0306-4379(03)00072-3</a></p><p>Tan, P.-N., Steinbach, M., Karpatne, A., &amp; Kumar, V. (2019). <em>Introduction to data mining</em> (2nd ed.). Pearson.</p><p>Zaki, M. J. (2000). Scalable algorithms for association mining. <em>IEEE Transactions on Knowledge and Data Engineering, 12</em>(3), 372–390. <a href="https://doi.org/10.1109/69.846291">https://doi.org/10.1109/69.846291</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4aaa384cc093" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>