What are recommendation systems in simple words?

Emre Ateş
10 min readJul 29, 2023

Have you ever received recommendations for products that have nothing to do with your previous purchases? If so, it means that the recommendation systems on the website where you shop are not working properly.

In this article, I tried to explain what recommendation systems are, how many different types of recommendation systems exist, and how these recommendation systems are used or can be used, in a simple manner. The article became a bit long due to the four different recommendation systems, but I wanted to prepare a flowing text with examples we might encounter in our daily lives, so that you can read it without getting bored.

I also touched upon a topic that you may encounter in job interviews. Without further ado, let’s get into the subject 😊

Recommendation systems are designed to filter abundant content (movies, series, books, clothes, electronics, etc.) based on the user’s preferences. They offer significant advantages for businesses and users alike. Companies can enhance customer satisfaction, strengthen customer loyalty, and increase sales by providing accurate recommendations.

Let’s say I have a grocery store, and you are one of my customers. This system is a technology that helps me suggest suitable products to you. Essentially, it tailors personalized recommendations based on your interests and past purchases.

It analyzes what you have previously bought and what types of products you have shown interest in. Then, based on this data, assists me in suggesting similar products that you might like or find appealing.

Let’s delve a bit deeper into the topic.

1. Simple Recommendation System

Let’s consider a scenario where you are making your first purchase from me. I am also seeing you for the first time, and I have no information about you. The products I can recommend to you are either seasonal items or the best-selling products in my store. For example, if it’s summer and you visit my shop, I can suggest strawberries to you. Or maybe I have a delicious homemade yogurt that all my customers love, and I can offer it to you.

I want to share an example from today that may help illustrate your point. Let’s think of it this way: Imagine you are a new Netflix user, and you are about to watch something for the first time. Netflix doesn’t know you; it has no data about you. In that case, it can initially recommend the following to you:

  • Most-watched movies/series based on your geographical location. Similar to how Grocery Store owner Emre recommended homemade yogurt, as it’s the most popular item among customers in your area.
  • Most liked movies/series in the last week. Similar to how Grocery Store owner Emre recommended the seasonal strawberries, as they are currently the trendiest/most popular products.

The Simple Recommendation System is straightforward yet highly effective. It is often used by businesses that do not have a dataset or prefer to provide suggestions to new customers.

2. Association Rule Learning

In this scenario, let’s assume you are an old or regular customer of Grocery Store Emre. For example, if you often buy fruits, our recommendation system will suggest fruit options to you. Similarly, if another customer of mine usually buys snacks, the system will offer snack options to that customer.

Association Rule Learning is simply a basket analysis. It analyzes the products you have previously purchased from me and allows me to make personalized recommendations based on that analysis. In this basket analysis, the Apriori algorithm is applied, which analyzes which products are frequently sold together or which products increase the likelihood of sales. Based on this analysis, we can create a sales strategy to enhance your shopping experience.

How does the Apriori algorithm work?

One day, you went to my grocery store. Let’s say you bought sourdough bread and fresh cheese. I noticed that you and other customers who bought fresh cheese usually also purchased sourdough bread. This is where Association Rule Learning comes into play. The Apriori algorithm helps to discover such relationships by analyzing the shopping data of customers. The algorithm identifies combinations of items that are often purchased together, revealing these relationships.

I, thanks to the Apriori algorithm, automatically suggest sourdough bread to a customer who is buying fresh cheese based on their shopping behavior. In the next step, I place the fresh cheese and sourdough bread shelves side by side, saving customers from wandering among other shelves, thereby saving their time and increasing my own profits 😊

Many e-commerce companies implement such shelf arrangements in their warehouses to deliver orders to customers faster.

When we examine the Apriori algorithm from a technical perspective, we can see that it has three fundamental metrics:

  1. Support: It represents the probability of selling fresh cheese in a shopping. For example, if the support metric is 0.2, it means that fresh cheese is sold in 20 out of 100 shopping transactions.
  2. Confidence: It is the probability of both fresh cheese and sourdough bread being sold together. For instance, if the confidence metric is 0.75, it means that 75% of the customers who buy fresh cheese also buy sourdough bread.
  3. Lift: It indicates how much X the sale of cottage cheese increases the sale of cheddar cheese. If the lift metric is 10, it means that cheese sales increase 10x in baskets that contain fresh cheese.

These metrics are essential in the Apriori algorithm as they help us analyze the relationships between different products and make accurate recommendations based on customer behavior.

I can use the Apriori algorithm in the following ways:

  1. Based on the Confidence metric, I can make recommendations to customers by suggesting products that are compatible with their shopping baskets. This can lead to increased customer satisfaction as they receive personalized recommendations and individualized promotions.
  2. Using the Lift metric, I can recommend products that have a strong association with the items that customers usually purchase. By encouraging cross-selling and suggesting complementary products, I can enhance the shopping experience for customers and potentially increase sales.

The Association Rule Learning and Apriori algorithm facilitates me in analyzing the preferences of my customers and making suitable product recommendations or proposing products with strong associations. This intelligent decision-making method enables me to better understand the needs of my customers and make them happier with their shopping experiences.

3. Content-Based Filtering

In this method, we focus on the unique characteristics of the products rather than looking at customers’ past shopping preferences. These characteristics may include product descriptions, product tags, a name of a film’s directors/actors, a singer, or the features of a product. All these contents are referred to as external information/meta-information.

Content-based filtering is used in situations where we do not have access to user information and interactions, and we only have a content-based structure.

Content-based filtering is a recommendation method that focuses on the characteristics of the products. On my online store, I already offer simple recommendation and association rule learning (basket analysis) methods for sales. Now, I want to add personalized recommendations to customers by focusing on the attributes of the products. In content-based filtering, the crucial aspect is having meta-information for each product, which means determining specific attributes of the products.

For example, the dessert “Magnolia” can have attributes or tags such as ‘light sweet’, ‘fruity’, and ‘milky dessert’. Similarly, a cake can have attributes like ‘chocolatey’, ‘fruity’, and ‘light sweet’. Using the meta-information of all products, I can mathematically represent all the products in his online store. This mathematical representation process is called vectorization. The vectorization process can be performed using methods such as “count vector” and “TF-IDF (term frequency-inverse document frequency),” and L2 normalization is applied. To put it simply:

  1. Count Vector: Count Vector is a method that converts text-based data into numerical vectors. It represents the text by counting how many times each word occurs in the text and converting it into a vector.
  2. TF-IDF (Term Frequency-Inverse Document Frequency): TF-IDF is a statistical method used to calculate the importance of a term in a document. It determines the importance of a term based on its frequency in the document (TF) and its frequency across all documents (IDF).

By using Count Vector and TF-IDF methods, I can effectively convert the meta-information of all products on my online store into numerical vectors and provide more efficient product recommendations based on the importance of terms in the documents.

If we go back to our example of cakes and magnolia dessert, if a customer has purchased a cake, Content-Based Filtering will also recommend the magnolia dessert to this customer. Why? Because the magnolia dessert has similar attributes (“light sweet” & “fruity”) to the cake that the customer purchased.

Thus, Content-Based Filtering provides recommendations based solely on the attributes of the products, without looking at the customer’s past purchase preferences. This helps you understand the individual preferences of customers.

Job review tip:

Let’s say you went for an interview at a company, and you received the following question: “We are a new e-commerce site selling toys. We want to set up a recommendation system for our customers. If you were in charge, how would you design a recommendation system?”

  • If there is no customer data available: I would use Simple Recommendation System + Content-Based Filtering. Because in both of these recommendation systems, I don’t need to know the specific preferences of the customers.
  • If there is customer basket information available: Association Rule Learning recommendation system + Content-Based Filtering.

4. Collaborative Filtering

Collaborative Filtering Collaborative Filtering is a method that relies on users’ preference patterns rather than the specific products they purchase. In other words, it uses techniques that reflect the collective opinions of the community, either at the user or item level. It is used when there are interactions available, such as likes or dislikes, from users.

Collaborative Filtering is commonly implemented in three ways:

  1. Item-based collaborative filtering
  2. User-based collaborative filtering
  3. Model-based collaborative filtering

Let me explain these filtering methods with examples again. Let’s say grocery store owner Emre, I, after using recommendation systems, expanded my business and started selling books and movies in his online store.

In User-Based Collaborative Filtering, when my customer, Liv Tyler, purchases a book titled “Harry Potter,” the method analyzes her preference for this book and looks at other customers. It investigates which books other customers who liked “Harry Potter” generally prefer and can recommend those books to Liv Tyler. Through this analysis, it may be determined that customers who liked “Harry Potter” also tend to prefer “The Lord of the Rings” series. In this case, the User-Based Collaborative Filtering method can recommend “The Lord of the Rings” book series to Liv Tyler.

Similarly, in Item-Based Collaborative Filtering, when my customer, Leonardo DiCaprio, purchases a movie titled “Interstellar,” the method analyzes his preference for this movie and looks at other customers. It investigates which movies other customers who liked “Interstellar” generally prefer and can recommend those movies to Leonardo DiCaprio. For instance, through this analysis, it may be determined that customers who liked “Interstellar” also tend to prefer sci-fi movies like “Inception.” In this case, the Item-Based Collaborative Filtering method can recommend the movie “Inception” to Leonardo DiCaprio.

It is essential to note that Item-Based Collaborative Filtering does not focus on user details but develops recommendations based on the properties of liked items.

Model-Based Collaborative Filtering, on the other hand, makes product recommendations based on customer preferences using mathematical models. This method typically analyzes customer-item matrices and discovers hidden relationships using techniques such as matrix factorization.

For example, Mehmet, a customer of mine, has previously purchased books in the “Science Fiction” genre. Model-Based Collaborative Filtering creates a matrix based on Mehmet’s past preferences, which includes information related to “Science Fiction” books.

Afterward, Model-Based Collaborative Filtering utilizes techniques like matrix factorization to discover hidden relationships within this matrix. For instance, it may observe that customers who bought books in the “Science Fiction” genre also tend to like books in the “Fantasy” genre.

Using these hidden relationships, Model-Based Collaborative Filtering can recommend “Fantasy” genre books to Mehmet. This allows Mehmet to explore books of a genre he hasn’t tried before but might enjoy based on his past preferences.

The Collaborative Filtering method can provide personalized recommendations to customers for books and movies on my online store, enhancing their overall shopping experience.

Although recommendation systems may involve complex algorithms, their fundamental logic is to offer customers tailored product suggestions based on their interests. This, in turn, leads to improved customer satisfaction and increased customer loyalty. Both I and my customers benefit from this approach, as I can enhance customer satisfaction while customers enjoy a more convenient shopping experience with personalized recommendations.

--

--