Skip to content

Instantly share code, notes, and snippets.

@MaartenGr
Created August 6, 2019 13:20
Show Gist options
  • Save MaartenGr/c39573e1e475938c4c81d5645538c64c to your computer and use it in GitHub Desktop.
Save MaartenGr/c39573e1e475938c4c81d5645538c64c to your computer and use it in GitHub Desktop.
from imblearn.over_sampling import SMOTE
# Different sampling strategies can be applied
X_resampled, y_resampled = SMOTE(sampling_strategy={"Fraud":1000}).fit_resample(X, y)
#
X_resampled = pd.DataFrame(X_resampled, columns=X.columns)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment