Skip to content

Instantly share code, notes, and snippets.

@sazio
Created August 28, 2020 14:20
Show Gist options
  • Save sazio/6faf6c8b8502f4a8bce43d4da78684d7 to your computer and use it in GitHub Desktop.
Save sazio/6faf6c8b8502f4a8bce43d4da78684d7 to your computer and use it in GitHub Desktop.
# Get percentage
norm_constant = train_sample_metadata.groupby('label')['label'].count()[0] + train_sample_metadata.groupby('label')['label'].count()[1]
(train_sample_metadata.groupby('label')['label'].count()/norm_constant).plot(figsize=(15, 5), kind='bar', title='Distribution of Labels in the Training Set')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment