Skip to content

Instantly share code, notes, and snippets.

@liannewriting
Last active October 14, 2021 15:46
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 liannewriting/365908582c6c8364c51d2144ee9f8577 to your computer and use it in GitHub Desktop.
Save liannewriting/365908582c6c8364c51d2144ee9f8577 to your computer and use it in GitHub Desktop.
python imbalanced data machine learning classification
from imblearn.over_sampling import SMOTE
smote = SMOTE(random_state=888)
X_resampled, y_resampled = smote.fit_resample(df_train[features], df_train['Class'])
y_resampled.value_counts()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment