def calculate_weighted_rating(df, min_vote, avg):
    """
    IMDB's formula for calculated a weighted rating.
    :param df: The movie metadata dataframe.
    :param min_vote: the minimum number of votes to be considered
    :param avg: the average vote score
    :return: the weighted rating.
    """
    average_rating = df['vote_average']
    vote_count = df['vote_count']
    denominator = min_vote + vote_count
    weight = ((vote_count / denominator) * average_rating) \
             + ((min_vote / denominator) * avg)
    return weight