Assignment 11: Personalized Recommender System

Approach

Author

Patricio Romero

Published

November 27, 2026

1 Project Overview

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

  1. How can movie rating patterns be used to generate personalized recommendations?

  2. Which movies should be recommended to users based on their previous ratings?

  3. How accurate are the personalized rating predictions?

  4. 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 dataset
movie_ratings <- readr::read_csv(
  "Data/movie_ratings.csv",
  show_col_types = FALSE
)

# Verify required variables
stopifnot(
  all(c("critic", "movie", "rating") %in%
      names(movie_ratings))
)

# Create dataset summary
dataset_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 table
dataset_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.

Show code
movie_ratings %>%
  head(6) %>%
  kable(
    caption = "Table 3. Movie Ratings Data Preview",
    align = c("l", "l", "c")
  ) %>%
  kable_styling(
    bootstrap_options = c(
      "striped", "hover", "condensed"
    ),
    full_width = FALSE,
    position = "center"
  )
Table 3. Movie Ratings Data Preview
critic movie rating
Burton Jungle Book 4
Burton Star Wars Force 4
Charley Captain America 4
Charley Deadpool 5
Charley Frozen 4
Charley Jungle Book 3

3.4 Missing Ratings

Not every user has rated every movie. These missing user-movie combinations represent opportunities for personalized recommendations.

Missing ratings will not be replaced with zeros because a missing rating does not indicate a negative opinion.

Show code
total_users <- n_distinct(movie_ratings$critic)

total_movies <- n_distinct(movie_ratings$movie)

possible_ratings <- total_users * total_movies

observed_ratings <- movie_ratings %>%
  distinct(critic, movie) %>%
  nrow()

missing_ratings <- possible_ratings - observed_ratings

missing_summary <- tibble(
  Description = c(
    "Possible user-movie combinations",
    "Observed ratings",
    "Missing ratings",
    "Rating coverage (%)"
  ),
  Value = c(
    possible_ratings,
    observed_ratings,
    missing_ratings,
    round(
      observed_ratings / possible_ratings * 100,
      2
    )
  )
)

missing_summary %>%
  kable(
    caption = "Table 4. Rating Coverage",
    align = c("l", "c")
  ) %>%
  kable_styling(
    bootstrap_options = c(
      "striped", "hover", "condensed"
    ),
    full_width = FALSE,
    position = "center"
  )
Table 4. Rating Coverage
Description Value
Possible user-movie combinations 96.00
Observed ratings 61.00
Missing ratings 35.00
Rating coverage (%) 63.54

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:

  1. Import and validate the movie rating data.
  2. Organize the ratings into a user-movie matrix.
  3. Calculate similarities between movies using observed ratings.
  4. Identify movies similar to those previously rated by each user.
  5. Predict ratings for movies that users have not rated.
  6. 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.