<jupyter_start><jupyter_text>ANN<jupyter_code>from keras.models import Sequential
from keras.layers import Dense, Dropout
x_train.shape, y_train.shape
clf = Sequential()<jupyter_output><empty_output><jupyter_text>First layer<jupyter_code>clf.add(Dense(units=32, activation='relu', input_shape=(8,)))<jupyter_output><empty_output><jupyter_text>Hidden layer<jupyter_code>clf.add(Dense(units=32, activation='relu'))<jupyter_output><empty_output><jupyter_text>Output layer<jupyter_code>clf.add(Dense(units=1, activation='sigmoid'))<jupyter_output><empty_output><jupyter_text>Compile<jupyter_code>clf.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
clf.summary()
clf.fit(x_train, y_train, batch_size=32, epochs=100, validation_split=0.2)
pd.DataFrame(clf.history.history).plot()
clf.evaluate(x_test, y_test)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14883720930232558, 'fraction_numerical': 0.015116279069767442, 'mean_word_length': 16.9375, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '479310', 'license': 'MIT', 'n_tokens_mistral': 351, 'n_tokens_neox': 339, 'n_words': 31, 'path': 'Titanic_Dataset_by_RandomForest_vs_ANN.ipynb', 'repo_name': 'nitinkumar388/Titanic-Dataset-by-RandomForest-vs-ANN', 'size': '860'}