text_plain_output_1.png
from sklearn.ensemble import RandomForestClassifier

from sklearn.preprocessing import StandardScaler

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

data = pd.read_csv('../input/creditcard.csv')

data['normalized_amt'] = StandardScaler().fit_transform(data['Amount'].values.reshape(-1, 1))
data = data.drop(['Amount'], axis=1)

data = data.drop(['Time'], axis=1)

x = data.iloc[:, data.columns != 'Class']
y = data.iloc[:, data.columns == 'Class']

y_train.values

y_train.values.ravel()

random_forest = RandomForestClassifier(n_estimators=100)
random_forest.fit(x_train, y_train.values.ravel())

y_pred = random_forest.predict(x_test)
random_forest.score(x_test, y_test)

y_pred1 = random_forest.predict(x)
y_pred1

y_pred1.round()