Skip to content

Instantly share code, notes, and snippets.

@tranctan
Last active February 3, 2020 08:09
Show Gist options
  • Save tranctan/6706e21ea0efacdb07247fa09a5282a4 to your computer and use it in GitHub Desktop.
Save tranctan/6706e21ea0efacdb07247fa09a5282a4 to your computer and use it in GitHub Desktop.
title tags
Machine Learning - Recommendation System
Machine Learning, Recommendation System

Machine Learning - Recommendation System

What is Recommendation System ?

A Recommender System (RecSys) or a Recommendation system is a subclass of information filtering system that seeks to recommend relevant items for users, based on their preference. Preference and relevance are subjective, and they are generally inferred by items users have consumed previously.

Recommendation Techniques

In order to identify the useful items for the user, a RS must predict that an item is worth recommending. In order to do this, it must be able to predict the utility of some of them, or at least compare the utility of some items, and then decide what items to recommend based on this comparison.

Popularity Model

In order to illustrate the utility prediction of a RS, consider a simple, non-personalized, recommendation algorithm that recommends just the most popular songs. The rationale for this approach is that with the lack of information about the user's preferences, something that is high utility by many users (is favorited by many users), will be more likely favorited by a generic user, at least rather a randomly selected song. Hence, the utility of these popular songs is predicted to be reasonably high for the generic users.

Formal Definition

Based on this paper, the view of recommendation computation as the prediction of the utility of an item for a user is defined as follow: The degree of utility of the user $u$ for the item $i$ is modeled as a real-valued function $R(u,i)$, for instance, in collaborative filtering considered as the ratings of users for items. Then the fundamental task of a collaborative filtering RS is to predict the value of $R$ over the pairs of users and items. In other words, we compute $\hat{R}(u,i)$ where $\hat{R}$ is the estimation, computed by the RS, of the true function $R$. Consequently, having computed this prediction for the active user $u$ on a set of items, i.e., $\hat{R}(u,i_1)$, ..., $\hat{R}(u,i_N)$, the RS will recommend the items $i_1,...,i_K$ ($K \leq N$) with the largest predicted utility ($K$ is typically a small number).

There are actually 6 different classes of recommendation approaches:

  • Content-based (Cognitive) Filtering: This method uses only descriptors and attributes of the items that users has previously consumed to model user's preferences. In other words, these algorithms try to recommend items that are similar to those that a user liked in the past (or is examining in the present). For example, if a user likes a web page with the words “mobile”, “pen drive” and “RAM”, the CBF will recommend pages related to the electronics world. Item description and a user's profile play an important role in Content-based filtering. In order to do that, we need to know the content of both the user and the item that we are considering. We construct the user-profile and item-profile using the content of shared attribute space. i.e, the items that are most related to the positively rated items are then recommended to the user. It is noticable that this method does not need the profile of other users since they do not influence recommendation. A content-based recommender works with data that the user provides, either explicitly (rating) or implicitly (clicking on the link). Based on that data, a user profile is generated, which is then used to make suggestions to the user. As the user provides more inputs or takes actions on the recommnedations, the engine becomes more and more accurate. Disadvantage: Over-specialization - Recommended item is similar to already referenced item and may not be useful for the user.

  • Collaborative Filtering: This method makes automatic predictions (filtering) about the interests of a specific user by collecting preferences or taste information from many users (collaborating). Collaborative Filtering uses either a user-based approach or an item-based approach. In the user-based approach, the users perform the main role. If a certain majority of the customers has the same taste then they join into one group. Recommendations are given to user based on evaluation of items by other users from the same group, with whom he/she shares common preferences. Item-based collaborative filtering calculates the similarities between different items in the dataset by using one of a number of similarity measures, and then these similarity values are used to predict ratings for user-item pairs not present in the dataset. Disadvantage: This method has the limitations of Cold-start problem where a recommender does not have enough information about a user or an item that is being considered to make relevant predictions.

  • Demographic:This type of system recommends items based on the demographic profile of the user (gender, country, age,...). The assumption is that different recommendations should be generated for different demographic niches. Many websites adopt simple and effective personalization solutions based on demographics. For example, users are dispatched to particular Web sites based on their language or country. Or suggestions may be customized according to the age of the user. While these approaches have been quite popular in the marketing literature, there has been relatively little proper RS research into demographic systems.

  • Knowledge-based: Knowledge-based systems recommend items based on specific domain knowledge about how certain item features meet users needs and preferences and, ultimately, how the item is useful for the user. Notable knowledgebased recommender systems are case-based. In these systems a similarity function estimates how much the user's needs (problem description) match the recommendations (solutions of the problem). Here the similarity score can be directly interpreted as the utility of the recommendation for the user.

  • Communitiy-based: This type of system recommends items based on the preferences of the users friends. This technique follows the epigram “Tell me who your friends are, and I will tell you who you are”. Evidence suggests that people tend to rely more on recommendations from their friends than on recommendations from similar but anonymous individuals. This observation, combined with the growing popularity of open social networks, is generating a rising interest in community-based systems or, as or as they usually referred to, social recommender systems. This type of RSs models and acquires information about the social relations of the users and the preferences of the user’s friends. The recommendation is based on ratings that were provided by the user’s friends. In fact these RSs are following the rise of social-networks and enable a simple and comprehensive acquisition of data related to the social relations of the users. The research in this area is still in its early phase and results about the systems performance are mixed.

  • Hybrid methods: These RSs are based on the combination of the above mentioned techniques. A hybrid system combining techniques A and B tries to use the advantages of A to fix the disadvantages of B. For instance, CF methods suffer from new-item problems, i.e., they cannot recommend items that have no ratings. This does not limit content-based approaches since the prediction for new items is based on their description (features) that are typically easily available. Given two (or more) basic RSs techniques, several ways have been proposed for combining them to create a new hybrid system.

Content-based Filtering vs Colaborative Filtering

https://stackoverflow.com/questions/16372191/whats-difference-between-item-based-and-content-based-collaborative-filtering https://www.analyticsvidhya.com/blog/2015/10/recommendation-engines/

Evaluation Metrics for Recommender System

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment