Skip to content

Instantly share code, notes, and snippets.

@ImadDabbura
Created August 3, 2018 20:41
Show Gist options
  • Select an option

  • Save ImadDabbura/179a61e94d3650384b326a4cc29d842c to your computer and use it in GitHub Desktop.

Select an option

Save ImadDabbura/179a61e94d3650384b326a4cc29d842c to your computer and use it in GitHub Desktop.
# Get number of positve and negative examples
pos = df[df["not_fully_paid"] == 1].shape[0]
neg = df[df["not_fully_paid"] == 0].shape[0]
print(f"Positive examples = {pos}")
print(f"Negative examples = {neg}")
print(f"Proportion of positive to negative examples = {(pos / neg) * 100:.2f}%")
plt.figure(figsize=(8, 6))
sns.countplot(df["not_fully_paid"])
plt.xticks((0, 1), ["Paid fully", "Not paid fully"])
plt.xlabel("")
plt.ylabel("Count")
plt.title("Class counts", y=1, fontdict={"fontsize": 20});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment