def cluster_rating(df, movie_id, cluster):
    """Return the average rating for a movie, based on the cluster"""
    cluster_rating = df[(df['movie_id'] == movie_id) & (df['cluster'] == cluster)]
    return cluster_rating['rating'].mean()