import pandas as pd
from imblearn.over_sampling import SMOTE
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
credit_cards=pd.read_csv('creditcard.csv')
columns=credit_cards.columns
#The labels are in the last column ('Class'). Simply remove it to obtain features columns
features=credit_cards['Class']
features_train,features_test,labels_train,labels_test=train_test_split(features,
labels,
test_size=0.2,
random_state=0)
oversampler=SMOTE(random_state=0)
os.features,os_labels=oversampler.fit_sample(feature_train,labels_test)
print(len(os_labels[os_labels==1]))