CHAPTER 10 Association Rules and Beyond


Association rules go beyond merely exploring products: They identify groups of products that tend to appear together. A big part of the allure and power of association rules is that they “discover” patterns automatically, rather than by the hypothesis testing methods used in the previous chapter.

A classical example of association rules is the beer and diapers story, which claims that the two items are purchased together late in the week. This makes for an appealing story. Young mom realizes that there are not enough diapers for the weekend. She calls young dad as he comes home from work, asking him to pick up diapers on the way home. He knows that if he gets beer (and drinks it), he won’t have to change the diapers.

Although a colorful (and sexist) explanation, association rules were not used to find this “unexpected” pattern (the details were explained in a Forbes article in 1998). In fact, retailers already knew that these products sold together. The story itself has been traced to Shopko, a chain of retail stores based in Green Bay, Wisconsin. During the many icy winter months in northern Wisconsin, store managers would easily notice customers walking out with bulky items such as beer and diapers. The observation was verified in the data.

Association rules can reduce millions of transactions on thousands of items into easy-to-understand rules. This chapter introduces the techniques for discovering association rules using SQL. Some ...

Get Data Analysis Using SQL and Excel, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.