This is a simple movie recommendation program that utilizes a movie rating dataset to provide movie recommendations based on user preferences. The program uses Python and pandas library for data processing and analysis.
The program uses two datasets:
ratings.dat: Contains information about movie ratings given by users. The dataset has columns likeuserId,movieId,rating, andtimestamp.movies.dat: Contains information about movies, including their titles and genres. The dataset has columns likemovieId,title, andgenres.
Both datasets are downloaded from the following URLs:
ratings.dat: https://raw.githubusercontent.com/Arnavsmayan/Movie-Recommender/main/ratings.datmovies.dat: https://raw.githubusercontent.com/Arnavsmayan/Movie-Recommender/main/movies.dat
- The program starts by importing the necessary libraries:
pandasandnumpy. - The program reads the
ratings.datfile usingpd.read_csv()function and assigns column names:userId,movieId,rating, andtimestamp. - It reads the
movies.datfile usingpd.read_csv()function and assigns column names:movieId,title, andgenres. - The program merges the
ratingandmoviedataframes using thepd.merge()function based on the commonmovieIdcolumn. - Unnecessary columns (
timestampandmovieId) are dropped from the merged dataframe using thedrop()function. - The program calculates the average rating and the number of reviews for each movie using the
groupby()andmean()functions. - The program displays the first few rows of the resulting dataframe, showing the average rating and the number of reviews for each movie.
The program displays two outputs:
- The first output is a dataframe that shows the average rating and the number of reviews for each movie. It includes columns:
title,Avg. Rating, andNo. of Reviews. - The second output is a dataframe that shows the average rating and the number of reviews for a subset of movies. It includes columns for each movie title and
userId.
Note: The second output dataframe only shows a few movie titles and userId columns for brevity. The actual dataframe includes columns for all movies and userId.
Please refer to the code cells in the notebook for the actual implementation and execution of the program.