Recommendation Systems and Association Rule Learning
Every day, most of us receive suggestions from a social media platform or an internet shopping site. These help us save our time in a way…
Recommendation Systems and Association Rule Learning
On this page, you will read about recommendation systems, and particularly association rule learning.

image by vektorjuice on freepik
Every day, most of us receive suggestions from a social media platform or an internet shopping site. Let’s have a look at how these recommendations are made, and what are the methods behind our screens.
The issue of recommendation systems is applied with different perspectives and methods.
- Simple Recommender Systems (Popularity, Trend)
- Association Rule Learning
- Content-Based Filtering
- Collaborative Filtering
— User-Based (memory/neighborhood-based)
— Item Based (memory/neighborhood-based)
— Model-Based (Matrix Factorization) (latent)
The most known of these is the simple recommendation systems, which are based on trends or popularity. The basic logic here is to distribute the trending product/content to all users.
The second method used in this subject is association rule learning, which is a rule-based machine learning method, shopping card in other words.
Apart from these two, we can talk about content-based filtering and collaborative filtering. Content-based filtering is using features of items like their descriptions, and it uses dot product and TF IDF scores to find closer items.
Collaborative filtering is a greater subject that includes item-based, user-based, and model-based (matrix factorization) filtering methods, which can be a topic of another writing.
Association Rule Learning(ARL)
“Those who bought this also bought…”
ARL is a rule-based machine learning method. It tries to catch certain patterns among the dataset we will get our hands-on. In this way, we can talk about the relationship between products and make suggestions. ARL is also called as market cart method. To make these suggestions it uses the apriori algorithm. Let's dive deep into the apriori algorithm.
Apriori Algorithm
Apriori Algorithm tries to find an association rule between two or more objects. There are three components of the apriori algorithm.
- support: Probability of x and y occurring together.
- Support(X,Y) = Freq(X,Y) / N
- confidence: Probability of buying y when x is bought.
- Confidence(X,Y) = Freq(X,Y) / Freq(X)
- lift: When one of x and y are bought, the increase coefficient of the probability of buying the other.
- Lift = Support(X,Y) / (Support(X) * Support(Y))
Apriori algorithm calculates these scores, and we can then select an item and find the best item to recommend selling with it. If we have a big dataset of a supermarket, we can analyze the records of invoices. We can understand which items are sold together mostly. Then we can create promotions or other selling strategies for these itemsets.
Although it is easy to understand and use, ARL with the apriori algorithm can be expensive because calculating needs to be done on the whole dataset.
You can use the apriori function in mlxtend library in python to calculate these scores.
from mlxtend.frequent_patterns import apriori, association_rules
apriori(df, min_support=0.5, use_colnames=False, low_memory=False)
Resources:
메타데이터
- post_id
- c6c1f986b775
- slug
- recommendation-systems-and-association-rule-learning-c6c1f986b775
- url
- https://medium.com/@maliakkin/recommendation-systems-and-association-rule-learning-c6c1f986b775
- canonical_url
- https://medium.com/@maliakkin/recommendation-systems-and-association-rule-learning-c6c1f986b775
- author_url
- https://medium.com/@maliakkin
- status
- ok
- fetched_at
- 2026-07-27 06:30:21