Created
September 29, 2019 10:34
-
-
Save dradecic/874c6f56bc1d92d3de45f6c170a5837f to your computer and use it in GitHub Desktop.
recommender1_8_scatter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ratings_df = pd.DataFrame() | |
ratings_df['Mean_Rating'] = data.groupby('title')['rating'].mean().values | |
ratings_df['Num_Ratings'] = data.groupby('title')['rating'].count().values | |
fig, ax = plt.subplots(figsize=(14, 7)) | |
ax.spines['top'].set_visible(False) | |
ax.spines['right'].set_visible(False) | |
ax.set_title('Rating vs. Number of Ratings', fontsize=24, pad=20) | |
ax.set_xlabel('Rating', fontsize=16, labelpad=20) | |
ax.set_ylabel('Number of Ratings', fontsize=16, labelpad=20) | |
plt.scatter(ratings_df['Mean_Rating'], ratings_df['Num_Ratings'], alpha=0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment