Last active
October 19, 2021 13:34
-
-
Save liannewriting/cf8be8f11b8e9136e6c795ececd8753c to your computer and use it in GitHub Desktop.
python imbalanced data machine learning classification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.model_selection import train_test_split | |
df_train, df_test = train_test_split(df, test_size=0.2, stratify=df['Class'], random_state=888) | |
features = df_train.drop(columns=['Class']).columns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment