Introduction to Recommendation Systems

Fatima Mubarak
Tech Blog
Published in
8 min readJul 17, 2023

The rise of e-commerce websites has increased business competition. Every e-commerce platform should strive to be unique to distinguish itself from competitors. If you have an in-depth knowledge of your clients, you may recommend products with greater confidence. Understanding customer preferences, which may be based on behavior, ratings, and comments, is critical.

The primary question is: How can we deliver high-quality recommendations? In this case, a recommendation system may be useful.

Photo by charlesdeluvio on Unsplash

What is a Recommendation system?

A recommendation system will generate product recommendations based on customer data. It will analyze user behavior and generate product recommendations based on similar user behavior using various types of filtering. The system will also analyze product features and generate recommendations based on a similar product.

Image Source: thingsolver.com

The Recommendation Engine Market size is expected to grow from USD 5,172.41 million in 2023 to USD 21,574 million by 2028, at a CAGR of 33.06% during the forecast period (2023–2028).

Taxonomy of recommender system (Research Gate)

Filtering techniques such as collaborative, content-based, and hybrid filtering are used to provide personalized recommendations. In addition to popularity filtering which used for non personalized filtering.

What is collaborative based filtering?

Collaborative filtering is a type of recommendation system that generates recommendations by analyzing the behaviors or preferences of multiple users. It is assumed that users with similar tastes or preferences will have similar preferences in the future. This technique does not require explicit knowledge about the properties of products or users. Instead, it relies on studying patterns in user-item interactions.

There are two forms of collaborative filtering:

  • Memory-based techniques
  • Model-based techniques

These approaches differ in how they process and interpret user-item interaction data to produce recommendations.

Memory-based collaborative filtering

In this approach, the system analyzes a user’s past behavior (such as ratings and purchase history) to identify patterns and similarities between users or items. This information is used to make personalized recommendations for you.

User & Item based collaborative filtering

Memory-based collaborative filtering is relatively easy to implement as it does not require training a model on the entire dataset. However, it can be computationally expensive and may not scale well with large datasets. Despite these limitations, memory-based collaborative filtering can provide valuable user recommendations based on similar user behavior and factors in the system.

There are two main types of memory-based collaborative filtering:

  1. User-based collaborative filtering: This method suggests products to users based on their shared preferences. For instance, if users A and B have similar product tastes, a user-based collaborative filtering algorithm may suggest to user A products that user B has given high ratings.
  2. Item-based Collaborative filtering: Similarities between items are computed using the ratings or interactions of users who have interacted with both items. Then items with similar interaction patterns will be recommended.

Model-based collaborative filtering

Model-based collaborative filtering is another approach to building recommender systems that use machine learning models to provide personalized product recommendations. Unlike memory-based collaborative filtering, which uses user-item interaction data directly, model-based collaborative filtering trains machine learning models based on past user-item interactions to learn patterns and make predictions.

Collaborative filtering (Image source: dzenanhazmic)

There is several popular model-based collaborative filtering:

Matrix Factorization

Matrix factorization is a technique that decomposes the user-item interaction matrix into low-rank matrices representing latent features. These latent features are hidden characteristics that will be learned during factorization.

Matrix Factorization(sigopt.com)

These sub-matrices represent these latent features that capture user preferences and item details. By factoring the original matrix, the model can predict missing entries and provide personalized recommendations. The most commonly used types in the recommendation system of matrix factorization are SVD and ALS.

Deep Learning

Deep learning models, such as neural networks, can be used to extract features and learn patterns from user-item interaction data. These models are capable of capturing complicated relationships and non-linear patterns in data.

Deep Learning Based Recommender System(ResearchGate)

A deep learning model, for example, can take user-item interaction data and learn hidden characteristics that represent user preferences and item characteristics. These learnt representations can subsequently be utilized to forecast ratings or provide recommendations.

Clustering

Clustering algorithms can be used to categorize users or items based on similarities in their interaction patterns. Clustering can assist in identifying unique user segments or item categories, allowing for more targeted and tailored recommendations.

Clustering (Divya Chandana-medium)

Clustering techniques, such as k-means or hierarchical clustering, can, for example, group users or items into clusters based on their preferences or attributes. Recommendations can then be provided within each cluster, adapting to the individual interests of the users or the features of the objects in that cluster.

Content-Based Collaborative Filtering

Content-based collaborative filtering is a recommendation system strategy that uses the characteristics or features of items as well as user preferences to produce recommendations. It focuses on identifying similarities and matching them to user preferences through analyzing the content or features of the items.

In content-based collaborative filtering, each item is associated with a set of features or properties. These attributes can be explicit characteristics, such as a product’s category, brand, or price, or they can be generated from the item’s content, such as keywords retrieved from text or visual aspects collected from photos.

Hybrid recommendation System

A hybrid recommendation system is an approach of providing more accurate, diverse, and tailored recommendations by combining multiple recommendation techniques or algorithms. It wants to make use on the advantages of various recommendation systems while minimizing their limitations.

Image Reference(Oreilly)

A hybrid recommendation system’s core idea is to combine different recommendation techniques, such as collaborative filtering, content-based filtering or popularity based filtering, to provide a more comprehensive and effective recommendation solution. This combination enables a more comprehensive understanding of user preferences and item attributes.

Popularity-Based Filtering

Popularity-based filtering is a straightforward approach for recommendation systems that suggests items based on their overall or user popularity. It is based on the idea that items that are popular are more likely to be attractive to a larger number of users.

Image Reference: (Hello Partner)

The number of times a user has purchased, viewed, rated, or engaged with an item is frequently used to determine its popularity. Items that are popular are regarded as more likely to be recommended to users, especially new users who have no preferences.

Evaluation Metrics in recommendation system

Evaluation of the efficiency and performance of recommendation algorithms or models is essential in recommendation systems. The goal of evaluation is to measure how well a recommendation system predicts or suggests items that are relevant and useful to users. There are several types of evaluation:

Similarity metrics

When we have an item’s meta-data, we may quickly recommend new items to the user. If we buy product A on Amazon, we can recommend another product based on detailed meta-data for other products and determine the distance between them and product A. Another approach is to describe product descriptions as vectors using NLP techniques such as Tf-Idf. We only need to choose a similarity metric.

  1. Cosine similarity
  2. Euclidean distance
  3. Pearson correlation

Offline Evaluation

In this kind of evaluation, system or model performance is evaluated using previously gathered data without taking into account real-time user interactions or feedback. It typically relies on historical data or a predetermined set of test data. Some commonly used metrics include:

Predictive metrics

Predictive metrics address the issue of how close recommender system ratings are to actual user ratings. The most common and straightforward prediction metrics are:

  1. Mean absolute error (MAE)
  2. Root mean squared error (RMSE)

Ranking-based metrics

If we have a candidate generation process that returns a ranked ordering of items, and items that are lower on the list are less likely to be used or viewed, then the following metrics should be evaluated:

  1. Average precision (AP)
  2. Mean Average Precision (MAP)
  3. Normalized Discounted cumulative gain (NDCG)

Online Evaluation and A/B Testing

Online evaluation involves deploying different recommendation algorithms or models in a live environment and measuring their performance based on real-time user interactions and feedback. A/B testing is commonly used, where different versions of the recommendation system are randomly assigned to different user groups, and their performance is compared based on metrics such as click-through rates, conversion rates, or user engagement.

Finally, depending just on ML metrics to evaluate the success of a recommender system is not enough. Only user feedback produces valuable results. This is why A/B testing should be done at all times. It enables us to track changes in conversion rate and sales.

Conclusion

Finally, recommendation systems are critical for offering tailored and relevant recommendations to users. Different recommendation systems, such as collaborative filtering, content-based filtering, popularity-based filtering, and hybrid approaches, provide diverse techniques for generating recommendations based on user preferences and item characteristics. Evaluating recommendation systems using metrics such as mean absolute error, mean average precision and normalized discounted cumulative gain helps to analyze how well they work and enhance the algorithms for better recommendations. Recommendation systems are important in improving user experiences and supporting item exploration.

If you want to know more about each type of recommendation system, wait for the upcoming articles.

References

--

--

Fatima Mubarak
Tech Blog

Data scientist @montymobile | In my writing, I explore the fields of data science , machine learning and related topics.