Content Based FIltering Recommendation System

Python Machine Learning

Python, Machine Learning.

This project implements a content-based filtering recommendation system to recommend movies to users based on their preferences. The recommendation system analyzes the content (genres, ratings, year, etc.) of movies and suggests similar movies that match the user's preferences.

Project Overview

The project consists of the following components:


To use the recommendation system, follow these steps:

import pandas as pd from math import sqrt import numpy as np import matplotlib.pyplot as plt %matplotlib inline

# We will use onehot encoding technique to convert the list of genres to a vector where each column corresponds to one possible value of the feature. # lets copy the dataframe into a new df moviesWithGenres_df = movies_df.copy() #For every row in the dataframe, iterate through the list of genres and place a 1 into the corresponding column for index, row in movies_df.iterrows(): for genre in row['genres']:[index, genre] = 1 #Filling in the NaN values with 0 to show that a movie doesn't have that column's genre moviesWithGenres_df = moviesWithGenres_df.fillna(0) moviesWithGenres_df.head()


The content-based filtering recommendation system provides personalized movie recommendations based on user preferences. By analyzing the content of movies, the system suggests similar movies that align with the user's interests. This project serves as a foundation for building more advanced recommendation systems and can be extended to other domains beyond movies.

View project