The goal of this project is to build a personalized movie recommendation system using R.
In Assignment 3A, I used the Global Baseline Estimate (GBE) to predict movie ratings based on the overall average, user bias, and movie bias.
For this assignment, I will extend that analysis by implementing a personalized recommendation algorithm.
The new system will use movie rating patterns to recommend movies based on each user’s preferences.
2 Research Questions
How can movie rating patterns be used to generate personalized recommendations?
Which movies should be recommended to users based on their previous ratings?
How accurate are the personalized rating predictions?
How does the personalized recommender compare with the Global Baseline Estimate?
3 Data Source
This project uses the same movie rating survey dataset from Assignment 3A: Global Baseline Estimate.
The dataset contains ratings provided by different users across six movies. These ratings will be used to develop a personalized recommendation system.
Dataset: movie_ratings.csv
File Location: Data/movie_ratings.csv
The original CSV file will be included in the GitHub repository to support reproducibility.
3.1 Data Import and Dataset Overview
The movie ratings dataset was imported from a CSV file using R and the readr package.
The following table summarizes the dataset used to develop the personalized recommendation system.
Show code
# Import the original movie ratings datasetmovie_ratings <- readr::read_csv("Data/movie_ratings.csv",show_col_types =FALSE)# Verify required variablesstopifnot(all(c("critic", "movie", "rating") %in%names(movie_ratings)))# Create dataset summarydataset_summary <-tibble(Description =c("Number of observations","Number of users","Number of movies","Number of variables","Rating scale","Data format","Import status" ),Value =c(nrow(movie_ratings),n_distinct(movie_ratings$critic),n_distinct(movie_ratings$movie),ncol(movie_ratings),"1 to 5","CSV","Successfully imported" ))# Display formatted tabledataset_summary %>%kable(caption ="Table 1. Movie Ratings Dataset Overview",align =c("l", "c") ) %>%kable_styling(bootstrap_options =c("striped", "hover", "condensed" ),full_width =FALSE,position ="center" )
Table 1. Movie Ratings Dataset Overview
Description
Value
Number of observations
61
Number of users
16
Number of movies
6
Number of variables
3
Rating scale
1 to 5
Data format
CSV
Import status
Successfully imported
The dataset was successfully imported and contains 61 observed ratings from 16 users across six movies. The three variables are critic, movie, and rating. These variables will be used to develop the personalized recommendation system.
3.2 Variable Description
The dataset contains three variables used to identify users, movies, and ratings.
Show code
variable_description <-tibble(Variable =c("critic","movie","rating" ),Type =c("Character","Character","Numeric" ),Description =c("Identifies the user who rated the movie","Identifies the movie being rated","Rating assigned by the user from 1 to 5" ))variable_description %>%kable(caption ="Table 2. Variable Description",align ="l" ) %>%kable_styling(bootstrap_options =c("striped", "hover", "condensed" ),full_width =FALSE,position ="center" )
Table 2. Variable Description
Variable
Type
Description
critic
Character
Identifies the user who rated the movie
movie
Character
Identifies the movie being rated
rating
Numeric
Rating assigned by the user from 1 to 5
3.3 Data Preview
The following table displays the first six observations from the original dataset.
The dataset contains 96 possible user-movie combinations, including 61 observed ratings and 35 missing ratings.
These missing combinations will be considered when generating personalized movie recommendations in the Code Base.
4 Proposed Recommendation Algorithm
I will use item-to-item collaborative filtering to build the personalized recommendation system.
This algorithm identifies similarities between movies based on ratings from users who have rated the same movies.
The model will follow these steps:
Import and validate the movie rating data.
Organize the ratings into a user-movie matrix.
Calculate similarities between movies using observed ratings.
Identify movies similar to those previously rated by each user.
Predict ratings for movies that users have not rated.
Generate personalized movie recommendations.
This approach allows the system to use individual user preferences instead of relying only on overall rating averages.
5 Recommendation Output
The recommender will produce two main outputs:
Predicted ratings: Estimated ratings for movies that a user has not rated.
Top-N recommendations: A ranked list of movies with the highest predicted ratings for each user.
The recommendations will exclude movies that the user has already rated.
6 Model Evaluation
The model will be evaluated using a hold-out method. A portion of the observed ratings will be reserved for testing, while enough ratings will be retained for training and calculating movie similarities.
The same training and testing data will be used to compare the personalized recommender with the Global Baseline Estimate.
Prediction accuracy will be evaluated using Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE).
7 Expected Results
I expect the personalized recommendation system to produce different recommendations for users based on their rating histories.
The comparison with the Global Baseline Estimate will help determine whether item-to-item collaborative filtering improves prediction accuracy.
The results will also demonstrate how user preferences can influence movie recommendations.
8 Limitations
This project has several limitations:
The dataset contains a small number of movies and observed ratings.
Some users may have limited rating histories.
Missing ratings may reduce the number of movies that can be compared.
Item similarities may be unreliable when there are few overlapping ratings.
The personalized method may not always outperform the baseline model.
These limitations will be considered when interpreting the results.
9 Next Steps
The Code Base will implement the proposed algorithm in R, generate personalized recommendations, evaluate prediction accuracy, and visualize the results.
The final analysis will compare the personalized recommender with the previous Global Baseline Estimate.
10 Appendix: AI Assistance
ChatGPT was used to help understand the assignment requirements, organize the project, improve English writing, and provide guidance on the proposed recommendation methodology and evaluation methods.
AI assistance was also used to explain collaborative filtering, personalized recommendations, and the comparison with the Global Baseline Estimate.
I selected the recommendation approach based on my previous Assignment 3A. I am responsible for reviewing the methodology, preparing the dataset, implementing the R code, verifying the results, and interpreting the final conclusions.