Created
May 30, 2020 10:53
-
-
Save cereniyim/f46e25618cdf10d27ba87219131ea8e5 to your computer and use it in GitHub Desktop.
Plot the distribution of two different array
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
def PlotPredictedVSActual(predictions, actuals): | |
figsize(20, 10) | |
plt.rcParams['font.size'] = 14 | |
# histogram of predictions | |
ax = plt.subplot(121) | |
ax.hist(predictions, | |
bins=10, | |
color = "#971539", | |
edgecolor = 'white') | |
ax.set_xlabel("points", size=14) | |
ax.set_xticks(range(80, 101)) | |
ax.set_ylabel("count", size=14) | |
ax.set_title("Predicted Distribution", size=16) | |
plt.grid(b=True, axis = 'y', alpha=0.3) | |
# histogram of actual values | |
ax2 = plt.subplot(122) | |
ax2.hist(actuals, | |
bins=20, | |
color = "#971539", | |
edgecolor = 'white') | |
ax2.set_xlabel("points", size=14) | |
ax2.set_xticks(range(80, 101)) | |
ax2.set_ylabel("count", size=14) | |
ax2.set_title("Actual Distribution", size=16) | |
plt.grid(b=True, axis = 'y', alpha=0.3) | |
# plt.savefig("PredictionsVSActuals.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment