text_plain_output_1.png
from keras.layers import Dense

from keras.layers import Dropout

from keras.models import Sequential

from sklearn.preprocessing import StandardScaler

import matplotlib.pyplot as plt

from sklearn.preprocessing import StandardScaler
sc = StandardScaler()
X_train = sc.fit_transform(X_train)
X_test = sc.transform(X_test)

classifier = Sequential()
classifier.add(Dense(units=12, kernel_initializer='uniform', activation='relu'))
classifier.add(Dropout(0.1))
classifier.add(Dense(units=12, kernel_initializer='uniform', activation='relu'))
classifier.add(Dropout(0.1))
classifier.add(Dense(units=1, kernel_initializer='uniform', activation='sigmoid'))
classifier.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])

y_test = y_test.astype('float64')
y_train = y_train.astype('float64')
classifierHistory = classifier.fit(X_train, y_train, batch_size=64, epochs=70, validation_data=(X_test, y_test))

classifier = Sequential()
classifier.add(Dense(units=12, kernel_initializer='uniform', activation='relu'))
classifier.add(Dropout(0.1))
classifier.add(Dense(units=12, kernel_initializer='uniform', activation='relu'))
classifier.add(Dropout(0.1))
classifier.add(Dense(units=1, kernel_initializer='uniform', activation='sigmoid'))
classifier.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
classifierHistory = classifier.fit(X_train, y_train, batch_size=64, epochs=70, validation_data=(X_test, y_test))

plt.plot(classifierHistory.history['accuracy'])
plt.plot(classifierHistory.history['val_accuracy'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()