Assignment 11: Personalized Recommender System

Code Base

Author

Patricio Romero

Published

November 29, 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 Recommendation Algorithm

I implemented item-to-item collaborative filtering to generate personalized movie recommendations.

The model uses Pearson correlation to identify similar movies based on observed ratings. It also incorporates the Global Baseline Estimate to support predictions when sufficient positive similarity information is unavailable.

11 Code Base: Implementation

11.1 User–Movie Utility Matrix

The first step is to organize the movie ratings into a user-movie utility matrix.

Each row represents a user, and each column represents a movie. The values show the ratings assigned by each user.

Missing values indicate movies that users have not rated. These values will remain missing because they represent unknown preferences rather than negative ratings.

Show code
# Create the user-movie utility matrix
ratings_matrix <- movie_ratings %>%
  select(critic, movie, rating) %>%
  pivot_wider(
    names_from = movie,
    values_from = rating
  ) %>%
  arrange(critic) %>%
  tibble::column_to_rownames("critic") %>%
  as.matrix()

# Prepare a formatted table for display
matrix_table <- ratings_matrix %>%
  as.data.frame() %>%
  tibble::rownames_to_column("User") %>%
  mutate(
    across(
      -User,
      ~ replace(
        as.character(.x),
        is.na(.x),
        "—"
      )
    )
  )

# Display the utility matrix
matrix_table %>%
  kable(
    caption = "Table 5. User–Movie Utility Matrix",
    align = "c"
  ) %>%
  kable_styling(
    bootstrap_options = c(
      "striped", "hover", "condensed",
      "responsive"
    ),
    full_width = FALSE,
    position = "center"
  )
Table 5. User–Movie Utility Matrix
User Jungle Book Star Wars Force Captain America Deadpool Frozen Pitch Perfect 2
Burton 4 4 — — — —
Charley 3 3 4 5 4 2
Dan — 5 — 5 — —
Dieudonne — 5 5 4 — —
Matt — 5 4 — 2 2
Mauricio 3 — 4 — 3 4
Max 2 4 4 4 4 2
Nathan — 4 — — — —
Param — 5 4 4 1 —
Parshu 5 3 4 3 5 2
Prashanth 5 4 5 5 5 —
Shipra 5 3 — — 4 —
Sreejaya 4 5 5 5 5 4
Steve — 4 4 — — —
Vuthy 3 — 4 5 3 3
Xingjia 5 — — — 5 —

The utility matrix contains 16 users and six movies.

This matrix helps identify patterns in movie ratings and provides the foundation for item-to-item collaborative filtering.

The original numeric matrix preserves missing values for similarity calculations and rating predictions.

12 Research Questions: Implementation and Results

12.1 Research Question 1: How can movie rating patterns be used to generate personalized recommendations?

Movie rating patterns can be used to identify movies that receive similar ratings from the same users.

I implemented item-to-item collaborative filtering using Pearson correlation. Similarities are calculated only when at least three users have rated both movies. Negative similarities are excluded, and a shrinkage factor reduces the influence of small overlaps.

Show code
# Function to calculate movie similarities
calculate_similarity <- function(data) {

  matrix_data <- data %>%
    select(critic, movie, rating) %>%
    pivot_wider(
      names_from = movie,
      values_from = rating
    ) %>%
    tibble::column_to_rownames("critic") %>%
    as.matrix()

  movies <- colnames(matrix_data)
  n_movies <- length(movies)

  similarity <- matrix(
    0,
    nrow = n_movies,
    ncol = n_movies,
    dimnames = list(movies, movies)
  )

  diag(similarity) <- 1

  for (i in seq_len(n_movies - 1)) {
    for (j in seq.int(i + 1, n_movies)) {

      x <- matrix_data[, i]
      y <- matrix_data[, j]

      common <- !is.na(x) & !is.na(y)
      overlap <- sum(common)

      if (overlap >= 3) {

        x_common <- x[common]
        y_common <- y[common]

        if (sd(x_common) > 0 &&
            sd(y_common) > 0) {

          correlation <- cor(x_common, y_common)

          score <- max(0, correlation) *
            overlap / (overlap + 3)

          similarity[i, j] <- score
          similarity[j, i] <- score
        }
      }
    }
  }

  similarity
}

# Global Baseline Estimate from Assignment 3A
fit_gbe <- function(data) {

  mu <- mean(data$rating)

  user_bias <- tapply(
    data$rating, data$critic, mean
  ) - mu

  movie_bias <- tapply(
    data$rating, data$movie, mean
  ) - mu

  list(
    mu = mu,
    user_bias = user_bias,
    movie_bias = movie_bias
  )
}

# Predict using the Global Baseline Estimate
predict_gbe <- function(critic, movie, model) {

  bu <- unname(model$user_bias[critic])
  bi <- unname(model$movie_bias[movie])

  if (is.na(bu)) bu <- 0
  if (is.na(bi)) bi <- 0

  prediction <- model$mu + bu + bi

  as.numeric(pmax(1, pmin(5, prediction)))
}

# Predict using item-to-item collaborative filtering
predict_cf <- function(
    critic, movie, data, baseline, similarity) {

  base_prediction <- predict_gbe(
    critic, movie, baseline
  )

  known <- data[
    data$critic == critic, ,
    drop = FALSE
  ]

  if (nrow(known) == 0 ||
      !movie %in% rownames(similarity)) {
    return(base_prediction)
  }

  weights <- as.numeric(
    similarity[movie, known$movie]
  )

  valid <- is.finite(weights) & weights > 0

  if (!any(valid)) {
    return(base_prediction)
  }

  previous_predictions <- vapply(
    known$movie[valid],
    function(m) predict_gbe(critic, m, baseline),
    numeric(1)
  )

  residuals <- known$rating[valid] -
    previous_predictions

  prediction <- base_prediction +
    sum(weights[valid] * residuals) /
    sum(weights[valid])

  as.numeric(pmax(1, pmin(5, prediction)))
}

# Calculate movie similarity using all observed data
item_similarity <- calculate_similarity(movie_ratings)

# Prepare movie similarity table
similarity_pairs <- as.data.frame(
  as.table(item_similarity)
) %>%
  transmute(
    Movie_1 = as.character(Var1),
    Movie_2 = as.character(Var2),
    Similarity = as.numeric(Freq)
  ) %>%
  filter(
    Movie_1 < Movie_2,
    Similarity > 0
  ) %>%
  arrange(desc(Similarity))


similarity_pairs %>%
  kable(
    caption = "Table 6. Movie Similarity Results",
    col.names = c(
      "Movie 1",
      "Movie 2",
      "Similarity"
    ),
    digits = 3,
    align = c("l", "l", "c")
  ) %>%
  kable_styling(
    bootstrap_options = c(
      "striped", "hover", "condensed", "responsive"
    ),
    full_width = FALSE,
    position = "center",
    font_size = 12
  )
Table 6. Movie Similarity Results
Movie 1 Movie 2 Similarity
Frozen Jungle Book 0.504
Captain America Frozen 0.431
Captain America Pitch Perfect 2 0.417
Captain America Jungle Book 0.392
Deadpool Pitch Perfect 2 0.352
Pitch Perfect 2 Star Wars Force 0.349
Captain America Star Wars Force 0.300
Captain America Deadpool 0.236
Deadpool Star Wars Force 0.197
Frozen Pitch Perfect 2 0.047
Jungle Book Pitch Perfect 2 0.044
Deadpool Frozen 0.043

Answer:

The algorithm identifies movies with similar rating patterns and uses these similarities to estimate a user’s preferences. Positive similarities help determine which previously rated movies can provide useful information for predicting an unrated movie.

The model also uses the Global Baseline Estimate when sufficient positive similarity information is unavailable.

12.3 Research Question 3: How accurate are the personalized rating predictions?

I used a hold-out evaluation to measure prediction accuracy.

One rating was randomly selected for testing from each user with at least three observed ratings. All remaining ratings were used for training.

The same training and testing sets were used for both models.

12.3.1 Evaluation Metrics: MAE and RMSE

To evaluate the accuracy of the recommendation system, I used two common metrics: Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE).

Mean Absolute Error (MAE)

MAE measures the average absolute difference between the actual movie ratings and the predicted ratings.

\[ MAE = \frac{1}{n}\sum_{i=1}^{n}|r_i-\hat{r}_i| \]

Where:

  • \(n\) = Number of predictions
  • \(r_i\) = Actual movie rating
  • \(\hat{r}_i\) = Predicted movie rating

For example, an MAE of 0.80 means that the predictions differ from the actual ratings by an average of 0.80 rating points.

A lower MAE indicates better prediction accuracy.

Root Mean Squared Error (RMSE)

RMSE measures the square root of the average squared difference between actual and predicted ratings.

\[ RMSE = \sqrt{\frac{1}{n}\sum_{i=1}^{n}(r_i-\hat{r}_i)^2} \]

RMSE gives greater importance to larger prediction errors because the differences are squared before calculating the average.

For example, an RMSE of 1.20 indicates a typical prediction error magnitude of 1.20 rating points, with greater influence from large errors.

A lower RMSE indicates better prediction accuracy.

Why use both metrics?

MAE provides an easy-to-understand measure of average prediction error, while RMSE helps identify whether the model makes large prediction errors.

Both metrics are measured in rating points, and lower values are better.

These metrics will be used to compare the personalized recommendation system with the Global Baseline Estimate.

Show code
# Reproducible train-test split
set.seed(1234)

test_ratings <- movie_ratings %>%
  group_by(critic) %>%
  filter(n() >= 3) %>%
  slice_sample(n = 1) %>%
  ungroup()

train_ratings <- anti_join(
  movie_ratings,
  test_ratings,
  by = c("critic", "movie")
)

# Train both models without test ratings
training_baseline <- fit_gbe(train_ratings)

training_similarity <- calculate_similarity(
  train_ratings
)

# Predict the held-out ratings
test_predictions <- test_ratings %>%
  mutate(
    GBE_Prediction = purrr::map2_dbl(
      critic, movie,
      ~ predict_gbe(
        .x, .y, training_baseline
      )
    ),
    Personalized_Prediction = purrr::map2_dbl(
      critic, movie,
      ~ predict_cf(
        .x, .y,
        train_ratings,
        training_baseline,
        training_similarity
      )
    )
  )

# Calculate MAE and RMSE
evaluation_results <- tibble(
  Model = c(
    "Global Baseline Estimate",
    "Item-to-Item Collaborative Filtering"
  ),
  MAE = c(
    mean(abs(
      test_predictions$rating -
        test_predictions$GBE_Prediction
    )),
    mean(abs(
      test_predictions$rating -
        test_predictions$Personalized_Prediction
    ))
  ),
  RMSE = c(
    sqrt(mean((
      test_predictions$rating -
        test_predictions$GBE_Prediction
    )^2)),
    sqrt(mean((
      test_predictions$rating -
        test_predictions$Personalized_Prediction
    )^2))
  )
)

evaluation_results %>%
  kable(
    caption = "Table 8. Model Prediction Accuracy",
    digits = 3,
    align = "l"
  ) %>%
  kable_styling(
    bootstrap_options = c(
      "striped", "hover", "condensed"
    ),
    full_width = FALSE,
    position = "center"
  )
Table 8. Model Prediction Accuracy
Model MAE RMSE
Global Baseline Estimate 1.269 1.538
Item-to-Item Collaborative Filtering 1.237 1.508

12.3.2 Actual vs. Predicted Movie Ratings

The following table compares the actual ratings reserved for testing with the predictions generated by both recommendation models.

The test dataset contains 11 observed ratings that were excluded from the training process.

For each observation, the table shows the actual rating, the Global Baseline Estimate prediction, the personalized recommendation prediction, and their absolute errors.

Show code
# Compare actual ratings with model predictions
holdout_details <- test_predictions %>%
  transmute(
    User = critic,
    Movie = movie,
    Actual_Rating = rating,
    GBE_Prediction = GBE_Prediction,
    Personalized_Prediction = Personalized_Prediction,
    GBE_Absolute_Error = abs(
      rating - GBE_Prediction
    ),
    Personalized_Absolute_Error = abs(
      rating - Personalized_Prediction
    )
  ) %>%
  mutate(
    across(
      where(is.numeric),
      ~ round(.x, 2)
    )
  )

# Display formatted table

holdout_details %>%
  kable(
    caption = "Table 9. Actual vs. Predicted Ratings",
    col.names = c(
      "User",
      "Movie",
      "Actual Rating",
      "GBE Prediction",
      "Personalized Prediction",
      "GBE Error",
      "Personalized Error"
    ),
    align = c("l", "l", "c", "c", "c", "c", "c")
  ) %>%
  kable_styling(
    bootstrap_options = c(
      "striped", "hover", "condensed", "responsive"
    ),
    full_width = FALSE,
    position = "center",
    font_size = 12
  ) %>%
  scroll_box(
    width = "100%"
  )
Table 9. Actual vs. Predicted Ratings
User Movie Actual Rating GBE Prediction Personalized Prediction GBE Error Personalized Error
Charley Jungle Book 3 3.73 3.94 0.73 0.94
Dieudonne Deadpool 4 5.00 5.00 1.00 1.00
Matt Frozen 2 3.85 4.26 1.85 2.26
Mauricio Captain America 4 3.63 4.37 0.37 0.37
Max Jungle Book 2 3.73 3.94 1.73 1.94
Param Frozen 1 4.52 4.26 3.52 3.26
Parshu Captain America 4 3.89 3.81 0.11 0.19
Prashanth Star Wars Force 4 5.00 5.00 1.00 1.00
Shipra Jungle Book 5 3.63 3.94 1.37 1.06
Sreejaya Jungle Book 4 4.93 4.94 0.93 0.94
Vuthy Deadpool 5 3.64 4.35 1.36 0.65

The table shows how closely each model predicted the 11 actual movie ratings.

The absolute error is the difference between the actual rating and the predicted rating, without considering whether the prediction was higher or lower.

MAE is calculated as the average absolute error across all test ratings. RMSE uses the squared prediction errors, giving greater weight to larger mistakes.

These results help explain how the evaluation metrics were calculated and allow a more detailed comparison between both models.

Answer:

The personalized recommendation model achieved an MAE of 1.237 and an RMSE of 1.508.

These results were calculated using 11 held-out ratings. Lower MAE and RMSE values indicate more accurate predictions.

Because the dataset is small, the results should be interpreted carefully.

12.4 Research Question 4: How does the personalized recommender compare with the Global Baseline Estimate?

The final step compares the prediction errors of both recommendation methods.

The Global Baseline Estimate uses the overall average, user bias, and movie bias. The personalized recommender adds information from similar movies and the user’s previous rating patterns.

Show code
# Prepare results for visualization
comparison_plot <- evaluation_results %>%
  pivot_longer(
    cols = c(MAE, RMSE),
    names_to = "Metric",
    values_to = "Error"
  )

# Compare model errors
ggplot(
  comparison_plot,
  aes(
    x = Metric,
    y = Error,
    fill = Model
  )
) +
  geom_col(
    position = position_dodge(width = 0.7),
    width = 0.6
  ) +
  geom_text(
    aes(label = sprintf("%.3f", Error)),
    position = position_dodge(width = 0.7),
    vjust = -0.4,
    size = 3.5
  ) +
  scale_y_continuous(
    expand = expansion(mult = c(0, 0.15))
  ) +
  labs(
    title = "Prediction Accuracy Comparison",
    subtitle = "Global Baseline vs. Personalized Recommender",
    x = "Evaluation Metric",
    y = "Prediction Error (Rating Points)",
    fill = "Model"
  ) +
  theme_minimal(base_size = 12) +
  theme(
    plot.title = element_text(face = "bold"),
    legend.position = "bottom"
  )

12.4.1 Model Validation

The following checks confirm that the dataset contains valid ratings, the training and testing datasets do not overlap, and the recommendation system does not recommend previously rated movies.

Show code
# Validate original dataset
stopifnot(
  nrow(movie_ratings) == 61,
  !anyDuplicated(
    movie_ratings[c("critic", "movie")]
  ),
  all(!is.na(movie_ratings$rating)),
  all(movie_ratings$rating >= 1),
  all(movie_ratings$rating <= 5)
)

# Validate training and testing sets
stopifnot(
  nrow(train_ratings) == 50,
  nrow(test_ratings) == 11,
  nrow(
    inner_join(
      train_ratings,
      test_ratings,
      by = c("critic", "movie")
    )
  ) == 0
)

# Confirm recommendations exclude rated movies
stopifnot(
  nrow(
    inner_join(
      recommendation_predictions,
      movie_ratings,
      by = c("critic", "movie")
    )
  ) == 0
)

# Validate model evaluation metrics
stopifnot(
  all(is.finite(evaluation_results$MAE)),
  all(is.finite(evaluation_results$RMSE))
)

cat("All validation checks passed.")
All validation checks passed.

The validation checks confirm that both models were evaluated on ratings excluded from training and that personalized recommendations contain only unrated movies.

Answer:

The Global Baseline Estimate obtained an MAE of 1.269 and an RMSE of 1.538.

The personalized recommender obtained an MAE of 1.237 and an RMSE of 1.508.

Compared with the Global Baseline Estimate, the personalized model reduced MAE and reduced RMSE on the test data.

The comparison shows whether movie similarities improve prediction accuracy beyond the Global Baseline Estimate. Since only a small number of ratings were tested, the results do not establish which method would perform better on a larger dataset.

13 Comparison with Assignment 3A

13.1 Case Study: Param’s Movie Recommendations

In Assignment 3A, I used the Global Baseline Estimate (GBE) to predict ratings for two movies that Param had not rated: Jungle Book and Pitch Perfect 2.

The GBE recommended Jungle Book because it had the higher predicted rating.

In Assignment 11, I used the same dataset to compare the original predictions with the new personalized recommendation system.

This comparison helps explain how collaborative filtering changes movie recommendations based on user preferences.

Show code
# Movies evaluated in Assignment 3A
param_movies <- tibble(
  Movie = c(
    "Jungle Book",
    "Pitch Perfect 2"
  )
)

# Compare both methods using the same dataset
param_comparison <- param_movies %>%
  mutate(
    GBE_Prediction = purrr::map_dbl(
      Movie,
      ~ predict_gbe(
        "Param",
        .x,
        full_baseline
      )
    ),
    Personalized_Prediction = purrr::map_dbl(
      Movie,
      ~ predict_cf(
        "Param",
        .x,
        movie_ratings,
        full_baseline,
        item_similarity
      )
    )
  )

# Display formatted comparison table

param_comparison %>%
  mutate(
    across(
      c(GBE_Prediction, Personalized_Prediction),
      ~ round(.x, 2)
    )
  ) %>%
  kable(
    caption = "Table 10. Assignment 3A vs. Personalized Recommendations",
    col.names = c(
      "Movie",
      "GBE Prediction",
      "Personalized Prediction"
    ),
    align = c("l", "c", "c")
  ) %>%
  kable_styling(
    bootstrap_options = c(
      "striped", "hover", "condensed", "responsive"
    ),
    full_width = FALSE,
    position = "center",
    font_size = 12
  )
Table 10. Assignment 3A vs. Personalized Recommendations
Movie GBE Prediction Personalized Prediction
Jungle Book 3.47 2.25
Pitch Perfect 2 2.28 2.63

13.2 Interpretation

The Global Baseline Estimate recommended Jungle Book with a predicted rating of approximately 3.47, compared with 2.28 for Pitch Perfect 2.

The personalized recommender produced different results. It predicted approximately 2.25 for Jungle Book and 2.63 for Pitch Perfect 2.

As a result, the personalized model recommended Pitch Perfect 2 instead of Jungle Book.

This difference shows how item-to-item collaborative filtering can change recommendations by considering movie similarities and individual user preferences.

However, these predictions do not prove which recommendation is more accurate because Param’s actual ratings for these movies are unknown.

The hold-out evaluation using MAE and RMSE provides a separate comparison of the prediction accuracy of both models.

14 Conclusion

This project extends Assignment 3A by implementing a personalized movie recommendation system using item-to-item collaborative filtering.

Both projects use the same dataset of 61 movie ratings from 16 users across six movies.

The Global Baseline Estimate predicts ratings using the overall average, user bias, and movie bias. The personalized recommender extends this method by considering similarities between movies and individual rating patterns.

The comparison for Param shows that the two methods produce different recommendations. The Global Baseline Estimate recommends Jungle Book, while the personalized model recommends Pitch Perfect 2.

Prediction accuracy was also evaluated using MAE and RMSE on the same testing data. These metrics help determine whether the personalized model improves predictions compared with the baseline.

Because the dataset is small, the results should be interpreted carefully. Future improvements could include more movie ratings and repeated model evaluations.

Overall, this project demonstrates how collaborative filtering can extend a baseline recommendation system and produce personalized movie recommendations.

15 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.