Created
May 19, 2019 15:40
-
-
Save netsatsawat/ac36c90028bba7c8d568117bdc4ba780 to your computer and use it in GitHub Desktop.
Check the target variable counts in train data set
This file contains hidden or 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
plt.figure(figsize=(10, 6)) | |
total_ = float(len(y_train)) | |
ax = sns.countplot(y_train) | |
for p in ax.patches: | |
height = p.get_height() | |
ax.text(p.get_x() + p.get_width() / 2., | |
height + 10, | |
'{0:1.1%}'.format(height / total_), | |
ha='center') | |
plt.title('Training label distribution', fontsize=16) | |
plt.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment