Created
February 3, 2019 21:22
-
-
Save terrah27/17233d8aa28c97b0b3be8d641c6eda4a to your computer and use it in GitHub Desktop.
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 imblearn.over_sampling import SMOTE | |
# Separate input features and target | |
y = df.Class | |
X = df.drop('Class', axis=1) | |
# setting up testing and training sets | |
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=27) | |
sm = SMOTE(random_state=27, ratio=1.0) | |
X_train, y_train = sm.fit_sample(X_train, y_train) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment