/Recommendation-Systems

Building powerful and personalized, recommendation engines with Python

Primary LanguageJupyter Notebook


Recommendation-Systems

Building powerful and personalized, recommendation engines with Python


Table of Contents
  1. Getting Started with Recommender Systems
  2. Manipulating Data with the Pandas Library
  3. Building The first recommender
  4. Building Content-Based Recommenders
  5. Getting Started with Data Mining Techniques
  6. Building Collaborative Filters
  7. Hybrid Recommenders
  8. Contact
  9. References

1. Getting Started with Recommender Systems

What is a recommender systems?

They are systems or techniques that recommend or suggest a particular product, service, or entity.

Types of recommender systems



Collaborative filtering

The power of community to provide recommendations. Ex: Amazon

Collaborative filtering can be classified into two types:

  • User-based filtering

The main idea is that if we are able to find users that have bought and liked similar items in the past, they are more likely to buy similar items in the future too

Ex: Amazon's Customers who bought this item also bought this item too

Customers who bought this item also bought

Customers who searched for this item ultimately bought

  • Item-based filtering

If a group of people have rated two items similarly, then the two items must be similar. Therefore, if a person likes one particular item, they're likely to be interested in the other item too.

Products related to this item

Collaborative filters suffer from what we call the cold start problem.

Content-based systems

Content-based systems do not require data relating to past activity. Instead, they provide recommendations based on a user profile and metadata (like: kind of movie "Romance") it has on particular items. Ex: Netflix

what Netflix does is ask you to rate a few movies that you have watched before. Based on this information and the metadata it already has on movies, it creates a watchlist for you.

Knowledge-based recommenders

The system that asks for certain specifics and preferences and then provides recommendations that satisfy those aforementioned conditions.

you could ask the user about their requirements for a house, such as its locality, their budget, the number of rooms, and the number of storeys, and so on. Based on this information, you can then recommend properties that will satisfy all of the above conditions.

Knowledge-based recommenders suffer from the problem of low novelty

Hybrid recommenders

Hybrid recommenders are robust systems that combine various types of recommender models. Hybrid systems try to nullify the disadvantage of one model against an advantage of another.

3. Building The first recommender

I use IMDB's weighted rating formula as our metric
	Mathematically, it can be represented as follows:
	Weighted Rating (WR) = (v ÷ (v+m)) × R + (m ÷ (v+m)) × C  where
	v  is the number of votes garnered by the movie
	m  is the minimum number of votes required for the movie to be in the chart (the prerequisite)
	R  is the mean rating of the movie
	C  is the mean rating of all the movies in the dataset
  • The simple recommender

The steps that used in this recommender are as follows: 1. Choose a metric (or score) to rate the movies on
2. Decide on the prerequisites for the movie to be featured on the chart 3. Calculate the score for every movie that satisfies the conditions
4. Output the list of movies in decreasing order of their scores

The dataset you can download it from here

  • The knowledge-based recommender

We are going to go ahead and build a knowledge-based recommender on top of our IMDB Top 250 clone. This will be a simple function that will perform the following tasks:

  1. Ask the user for the genres of movies he/she is looking for
  2. Ask the user for the duration
  3. Ask the user for the timeline of the movies recommended
  4. Using the information collected, recommend movies to the user that have a high weighted rating (according to the IMDB formula) and that satisfy the preceding conditions

4. Building Content-Based Recommenders

We are going to build two types of content-based recommender with our movies dataset We use some feature extraction techniques like:

  • CountVectorizer. you can know more. from here
  • TF-IDFVectorizer. you can know more. from here

Also, you can know more about The cosine similarity score. from here

  • Plot description-based recommender

    This model compares the descriptions and taglines of different movies, and provides recommendations that have the most similar plot descriptions
  • Metadata-based recommender

    This model takes a host of features, such as genres, keywords, cast, and crew, into consideration and provides recommendations that are the most similar with respect to the aforementioned features.