Association Rule Learning

Amit Ranjan
Analytics Vidhya
Published in
4 min readDec 2, 2020

Association Rule Learning is a data mining technique which allows us to get interesting insights of relationship among the items. If I have to define it in one line I can simply say,

Association Rule Learning is simply about finding association between two different things. For example, People who bought Bread also bought Butter or, People who watched 3 Idiots also watched Chhichhore etc.

These Association rule can be used to find the correlation between distinct items.

It can be best understood by the Market Basket Analysis. Let’s understand it by analogy. Suppose you are the owner of an amazing FashX store where you sell all kinds of Socks, Slippers and Shoes.

FashX Store

Your business is really going good. Customers are purchasing different Shoes and Slippers . You feel great and thought I should sell Caps and inners too in order to increase the sales. On the very next day you took lots of Caps and inners from the dealer and fill your store. You were happy that your sale will skyrocket. Unfortunately, things didn’t turn like you wanted. People were buying only Slippers, Shoes along with Socks. This happened the whole month. Now you were getting frustrated and went to your friend home who is also a Data Scientist.

And the conversation begins….

You: Hey Dipesh! I am really frustrated yar, I need some advice.

Dipesh: Hey, What happened?

You: As you know I have been doing great in selling Shoes and Slippers at my store.

Dipesh: Yeah man! You are the biggest seller of those two items in our city.

You: I know bro. With that thought I planned to add more items in my store like Caps and Inners in my store last month. I added it too. But the sales of new items is very low. I bought too many boxes of Caps and Inners by watching my success in selling the Shoes and Slippers. Customers buy Shoes or Slippers but they don’t buy Caps or Inners.

Dipesh: Oh! that’s really an unfortunate thing. Why do you think it is happening? Have you tried to talk to customers why they are not interesting?

You: I did. Most of the customers say that they don’t really need it so they don’t buy. Now I am screwed!

Dipesh: Hey bro, Don’t say like that. Let’s find some way to tackle this situation.

You: I have thought of every possible ways to think and trust me there is no way.

Dipesh: Can you share your sales data with me?

You: I can but why do you want it?

Dipesh: I have been studying this Association Rule Learning which finds some sort of correlation between things which likely to occur.

You: I don’t know man! If you want to see it you can have it but I am not sure it will be of any help.

Dipesh: Let’s see.

Then you went your home back and send a big excel file having all transactions to your friend Dipesh.

Next Day…

Dipesh called you and asked Are you free? I think I have something to solve your problem. You got curious and said yeah sure. I am coming at your place.

You: Hey bro! What happened?

Dipesh: Man the data you gave me yesterday was very insightful. I think I might have solution to your problem.

You: Really??

Dipesh: Yeah, See here. According to these data 95% of your customer purchase Socks with Slippers and Shoes.

You: What’s new in this? This I already know.

Dipesh: No man you are not getting. Almost all of your customer buy socks with slippers and shoes. Now look at your store photos. You have divided your store into two sections. In one section you have placed all the collection of Shoes and Slippers along with Socks. In another section you have placed all the new items like Caps or Inners you want to sell. Most people are visiting only one section leaving another section.

You: Yes bro! This is to make sure that customer find everything they need at one place. What’s the catch?

Dipesh: See.. I think that’s the problem. You should place your socks in another section.

You: Man What are you saying? It will be suicide.,

Dipesh: No bro! Almost all your customers who buy Shoes or Slippers buy socks. So they will buy socks no matter where you place them in your store.

Dipesh: Do one thing, Place your socks in another section and put Caps and Inners in between them. So the people who have selected the Shoes and now going for the selection of matching pair of socks will have a look at different variety of Caps they can pair with their outfit. And for sales of those caps and inners put a combo offer like those who will buy Shoes and Socks or Slippers and Socks will be entitled to have discount of 20% on these combos. People will definitely buy it.

You: Oh! I never thought in that way. It might work.

Dipesh: Yes bro! Try it.

Next Day…

You placed everything as per you and Dipesh have discussed.

One week passed by and you thought let’s see the sales data to understand how much sale of those Caps and Inners are going on!

You were surprised that almost 50% of your stock of Caps and Inners has been sold. You called Dipesh..

You: Hey Dipesh! You were right man. The sale did increased. How did you find all those connections just from the sale data.

Dipesh: I haven’t done anything this was all possible because of Association Rule Learning which helped me to understand the correlation between different item set.

You: Wow yar! It is truly amazing. You saved me big time.

--

--