The problem involves implementing a Global Baseline Estimate (GBR) recommender system in R using the given movie-rating dataset. The dataset is provided in Excel format and contains ratings from 17 critics for six different movies. To implement the recommender system, the first step is to understand the concept and methodology of the Global Baseline Estimate. This involves identifying the key components required for the calculation, including the overall average rating, user bias, and movie bias. These values must then be prepared and processed through an appropriate R data pipeline to calculate the baseline estimates and generate movie recommendations. The final objective is to use these calculations to produce predicted ratings and identify the recommended movie based on the Global Baseline Estimate.
Global Baseline Estimator (GBE)
The Global Baseline Estimate is an item-based, non-personalized recommender system that uses historical user ratings to estimate how highly a movie is likely to be rated. Unlike personalized recommendation systems, such as content-based filtering or item-item collaborative filtering, the Global Baseline Estimate does not primarily rely on finding users with similar preferences. Instead, it establishes a baseline prediction for each movie by considering the overall rating behavior in the dataset, individual user rating tendencies, and the tendency of each movie to receive ratings above or below the overall average.
The algorithm is based on three main components:
1. Overall Average Rating (Global Mean)
The overall average rating represents the mean rating across all movies and all users in the dataset. It provides a general indication of the rating level within the entire survey. This value serves as the starting point for estimating the expected rating of a movie.
2. User Bias
User bias captures the tendency of an individual user to rate movies either higher or lower than the overall average. For example, some users may generally give ratings of 4 or 5, while others may be more conservative and usually give ratings of 2 or 3. The user bias measures this difference and adjusts the baseline estimate accordingly.
3. Movie/Item Bias
Movie bias represents the tendency of a particular movie to receive ratings that are consistently higher or lower than the overall average rating. For example, if a movie generally receives ratings above the global average, it will have a positive movie bias. Conversely, a movie that tends to receive lower ratings will have a negative movie bias.
Why it is called “Global Baseline”?
It is because of the fact that this recommender system does not need any of the sophistication. It neither needs and calculation nor complex computation such as content-based filtering, item-item collaborative filtering or neural networks. Rather, it is used for benchmarking, for example; if a more sophistical system is not producing substantially better results than the GBE. In that case the GBE is preferred and low cost. For this assignment, it is important that we have to calculate the global mean, user biases, user biases and after that generate predicting ranges from out survey data.
Given data (in excel format)
This table represents a User-Item Movie Rating Matrix, which serves as the foundational dataset for building recommendation algorithms (such as Collaborative Filtering or Global Baseline Estimates).
• Columns (Movies/Items): Represents 6 feature films (Captain America, Deadpool, Frozen, Jungle Book, Pitch Perfect 2, and Star Wars Force).
• Cells (Ratings): Numerical scores assigned by critics on a 1-to-5 scale.
Key Characteristics
• Sparse Matrix / Missing Data: Blank cells indicate unobserved data—movies a critic hasn’t watched or rated yet (e.g., Burton has only rated Jungle Book and Star Wars Force). Out of 96 total possible rating cells, only 61 are populated.
Approach / Application of the algorithm in the given data
To implement the Global Baseline Estimate recommender system, I will first prepare the movie ratings data in a tidy format, with each row representing a single user–movie rating. I will then calculate the overall mean rating, followed by user and movie bias terms to capture deviations from the global average. These components will be combined to generate predicted ratings for each user–movie pair. Finally, I will review the results, handle missing values appropriately, and verify that the implementation is consistent with the algorithm provided in the spreadsheet and produces reproducible results.
Conclusion
I implemented a Global Baseline Estimate recommender system on the movie ratings dataset to predict missing user ratings. Following the methodology outlined in the reference spreadsheet, the model combines the global mean rating with user-specific and movie-specific bias terms. These predicted values were then used to generate a top movie recommendation for each user. While non-personalized, this approach establishes a transparent, highly interpretable benchmark against which more complex collaborative filtering models can be evaluated.
Implementataion
library(dplyr)
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
# 3. Read the MovieRatings sheetdf_raw <-read_excel(temp_file, sheet ="MovieRatings")# Verify download was successfulprint(head(df_raw))
# A tibble: 6 × 7
Critic CaptainAmerica Deadpool Frozen JungleBook PitchPerfect2 StarWarsForce
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Burton NA NA NA 4 NA 4
2 Charley 4 5 4 3 2 3
3 Dan NA 5 NA NA NA 5
4 Dieudon… 5 4 NA NA NA 5
5 Matt 4 NA 2 NA 2 5
6 Mauricio 4 NA 3 3 4 NA
# Example Output: How Param would rate Pitch Perfect 2param_pitch_perfect <- predictions %>%filter(Critic =="Param"& Movie =="PitchPerfect2") %>%pull(Predicted_Rating)cat("\nParam's Global Baseline Estimate for Pitch Perfect 2:", round(param_pitch_perfect, 2), "\n")
Param's Global Baseline Estimate for Pitch Perfect 2: 2.28