July 2018
Beginner to intermediate
146 pages
3h 39m
English
The final value that we need to discover before we calculate our scores is C, the mean rating for all the movies in the dataset:
# Calculate CC = df['vote_average'].mean()COUTPUT:5.6182072151341851
We can see that the average rating of a movie is approximately 5.6/10. It seems that IMDB happens to be particularly strict with their ratings. Now that we have the value of C, we can go about calculating our score for each movie.
First, let us define a function that computes the rating for a movie, given its features and the values of m and C:
# Function to compute the IMDB weighted rating for each moviedef weighted_rating(x, m=m, C=C): v = x['vote_count'] R = x['vote_average'] # Compute the weighted score return (v/(v+m) ...
Read now
Unlock full access