Skip to content

Instantly share code, notes, and snippets.

@liannewriting
Created October 13, 2021 17:22
Show Gist options
  • Save liannewriting/904f4ffc26eefd472161b4c76b42932c to your computer and use it in GitHub Desktop.
Save liannewriting/904f4ffc26eefd472161b4c76b42932c to your computer and use it in GitHub Desktop.
python imbalanced data machine learning classification
from imblearn.under_sampling import ClusterCentroids
cc = ClusterCentroids(random_state=888)
X_resampled, y_resampled = cc.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