Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created December 12, 2020 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/75fb14fa60b4a9fb94397e641f0bfe21 to your computer and use it in GitHub Desktop.
Save amankharwal/75fb14fa60b4a9fb94397e641f0bfe21 to your computer and use it in GitHub Desktop.
smt = SMOTE()
X_smote, y_smote = smt.fit_resample(X, y)
plt.figure(figsize=(12, 8))
plt.title('Repartition after SMOTE')
plt.scatter(X_smote[y_smote==1][:, 0], X_smote[y_smote==1][:, 1], label='class 1')
plt.scatter(X_smote[y_smote==0][:, 0], X_smote[y_smote==0][:, 1], label='class 0')
plt.legend()
plt.grid(False)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment