text_plain_output_1.png
from keras import callbacks

from keras.layers import Dense, BatchNormalization, Dropout, LSTM

from keras.models import Sequential

from sklearn.metrics import accuracy_score

from sklearn.metrics import matthews_corrcoef

from sklearn.preprocessing import StandardScaler

from sklearn.tree import DecisionTreeClassifier

import numpy as np

import numpy as np # linear algebra

model = DecisionTreeClassifier(random_state=0)
model.fit(X_train, y_train)

from keras.layers import Dense, BatchNormalization, Dropout, LSTM
from keras.models import Sequential
from keras.utils import to_categorical
from keras import callbacks
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
early_stopping = callbacks.EarlyStopping(min_delta=0.001, patience=20, restore_best_weights=True)
model = Sequential()
model.add(Dense(units=9, kernel_initializer='uniform', activation='relu', input_dim=12))
model.add(Dense(units=9, kernel_initializer='uniform', activation='relu'))
model.add(Dense(units=7, kernel_initializer='uniform', activation='relu'))
model.add(Dense(units=5, kernel_initializer='uniform', activation='relu'))
model.add(Dense(units=1, kernel_initializer='uniform', activation='sigmoid'))
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
history = model.fit(X_train, y_train, batch_size=32, epochs=500, validation_split=0.2, callbacks=[early_stopping])
val_accuracy = np.mean(history.history['val_accuracy'])
print('\n%s: %.2f%%' % ('val_accuracy', val_accuracy * 100))