Skip to content

Movie recommendation system based on popularity and also using KNN and Cosine similarity. 🎥🍿

Notifications You must be signed in to change notification settings

EsratMaria/Improved-Movie-Recommendation-System-with-KNN-and-Cosine-Similarity

Repository files navigation

Recommendation System

Recommendation systems improve the quality of search results and provide elements that are more relevant to the search item or that are related to the search history of the user. Recommendation systems are widely used to recommend movies, items, restaurants, places to visit, items to buy, etc.

Types of recommendation System

  • Popularity Based: It keeps track of view counts for each movie/video and then lists movies based on views in descending order.

  • Content Based: This type of recommendation system, takes in a movie that a user currently likes as input. Then it analyzes the contents of the movie to find out other movies that have similar content. Then it ranks similar movies according to their similarity scores and recommends the most relevant movies to the user.

  • Collaborative filtering: In this category, the recommendations get filtered based on the collaboration between similar user preferences.

In this repository, I tried making a movie recommendation system that suggests relevant movies according to a user's interest and previously rated movies.

Dataset

I am using the MovieLens dataset. The data consists of 105339 ratings applied over 10329 movies.

The movies.csv dataset contains three columns:

movieId: the ID of the movie
title: Movie title
genres: movies genres

The ratings.csv dataset contains four columns:

userId: the ID of the user who rated the movie.
movieId: the ID of the movie
ratings: ratings given by each user (from 0 to 5)
Timestamp: The time the movie was rated.

The CSV files can be found here.

Approaches Tried

  • Deleting Unnecessary Columns
  • Remove the NaN values from the dataset
  • Combining the files and making a pivot table
  • Data Transformations
  • Data Cleaning
  • Data Exploration and fetching detailed information, details are here.

Recommendation Strategies

  • KNN (K- Nearest Neighbor)
  • Cosine Similarity
  • Popularity (most rated) based recommender

References