My approach will be very similar to the confusion matrix assignment and first understand what is being asked in particular what “Global Baseline Estimate” is and what type of value that number provides. I will have to pull in my movie data using the same methods previously from SQLite. So the first step will be the load the data and determine the global mean rating from that data. From the Equation i can see it is Global Estimate = global mean + movie mean vs the global + user rating vs the global.
My goal using this data-set will be to determine a rating for Captain America for Burton. I’m going to focus on 1-cell for this assignment. I decided to use a different data-set provided by the instructor
Loading Data from Github Raw
My first step will be to load data from excel, using the provided data-set
'data.frame': 16 obs. of 7 variables:
$ Critic : chr "Burton" "Charley" "Dan" "Dieudonne" ...
$ CaptainAmerica: int NA 4 NA 5 4 4 4 NA 4 4 ...
$ Deadpool : int NA 5 5 4 NA NA 4 NA 4 3 ...
$ Frozen : int NA 4 NA NA 2 3 4 NA 1 5 ...
$ JungleBook : int 4 3 NA NA NA 3 2 NA NA 5 ...
$ PitchPerfect2 : int NA 2 NA NA 2 4 2 NA NA 2 ...
$ StarWarsForce : int 4 3 5 5 5 NA 4 4 5 3 ...
Calculating the Global Mean
Un-list is needed here to separate the numbers from a table structure in order to perform computations and get the mean, the mean function requires it.
We now have all the bias for every user and every movie. However, I am focusing on the user Burton and the movie Captain America. I will therefore need to identify the user bias for Burton and the movie bias for captain america before i can plug in to the final equation
The final equation for predicted rating was 3.934426 (Global Mean) + 0.06557377 (User Bias) + 0.338301 (Item Bias) = 4.338301 (Predicted Rating)
What we found is the suggested rating for the movie Captain America using the global baseline estimate is 4.34 out of 5. This is higher than the global mean. Therefore using the algorithm we would recommend Captain America for Burton or rather he would be expected to enjoy the movie.