Load required libraries

In [344]:
import pandas as pd
import numpy as np
from keras.layers import Dense
from keras.models import Sequential
from keras.utils import to_categorical 

Read data

In [345]:
training = pd.read_csv('./train.csv', header=0, index_col='PassengerId')
test = pd.read_csv('./test.csv', header=0, index_col='PassengerId')
In [346]:
def process_dataset(dataset):
    ## Separate data input from labels and remove useless columns
    dataset_X = dataset
    
    # Remove the label and the columns Name and Ticket which are not relevant
    dataset_X.drop(['Name', 'Ticket'], axis=1, inplace=True)
    
    # Convert columns to categorical data
    dataset_X['Pclass'] = dataset_X['Pclass'].astype('category')
    dataset_X['Sex'] = dataset_X['Sex'].astype('category')
    dataset_X['Embarked'] = dataset_X['Embarked'].astype('category')
    
    # Handling missing data
    # Age: using average (alternative use average per sex)
    # Filling up missing values in Age column
    age_average = training_X['Age'].mean()
    dataset_X['Age'].fillna(age_average, inplace=True)

    # Embarked: use most common value to fill missing data
    # Filling up missing values in Embarked column
    embarked_most_common = dataset_X['Embarked'].value_counts().idxmax()
    dataset_X['Embarked'].fillna(embarked_most_common, inplace=True)

    # Cabin: there are too many missing data points and no clear hypothesis to use, drop column
    # Removing column Cabin
    dataset_X.drop('Cabin', axis=1, inplace=True)
    
    dataset_X = pd.get_dummies(dataset_X, columns=['Sex', 'Embarked'])
    
    return dataset_X
In [347]:
training_y = training['Survived']
training_X = process_dataset(training)
training_X.drop('Survived', axis=1, inplace=True)
In [348]:
predictors = training_X.as_matrix()
ncols = predictors.shape[1]
target = to_categorical(training_y)

model = Sequential()
model.add(Dense(10, activation='relu', input_shape=(ncols,)))
model.add(Dense(10, activation='relu'))
model.add(Dense(10, activation='relu'))
model.add(Dense(10, activation='relu'))
model.add(Dense(10, activation='relu'))
model.add(Dense(10, activation='relu'))
model.add(Dense(10, activation='relu'))
model.add(Dense(10, activation='relu'))
model.add(Dense(10, activation='relu'))
model.add(Dense(10, activation='relu'))
model.add(Dense(2, activation='softmax'))
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
model.fit(predictors, target, epochs=500)
Epoch 1/500
891/891 [==============================] - 2s 3ms/step - loss: 0.6959 - acc: 0.5129
Epoch 2/500
891/891 [==============================] - 0s 102us/step - loss: 0.6782 - acc: 0.6162
Epoch 3/500
891/891 [==============================] - 0s 105us/step - loss: 0.6490 - acc: 0.6162
Epoch 4/500
891/891 [==============================] - 0s 104us/step - loss: 0.6260 - acc: 0.6162
Epoch 5/500
891/891 [==============================] - 0s 99us/step - loss: 0.6183 - acc: 0.6162
Epoch 6/500
891/891 [==============================] - 0s 101us/step - loss: 0.6099 - acc: 0.6352
Epoch 7/500
891/891 [==============================] - 0s 102us/step - loss: 0.6029 - acc: 0.7093
Epoch 8/500
891/891 [==============================] - 0s 101us/step - loss: 0.5951 - acc: 0.7071
Epoch 9/500
891/891 [==============================] - 0s 100us/step - loss: 0.5867 - acc: 0.7127
Epoch 10/500
891/891 [==============================] - 0s 102us/step - loss: 0.5785 - acc: 0.7138
Epoch 11/500
891/891 [==============================] - 0s 102us/step - loss: 0.5491 - acc: 0.7284
Epoch 12/500
891/891 [==============================] - 0s 102us/step - loss: 0.5313 - acc: 0.7351
Epoch 13/500
891/891 [==============================] - 0s 100us/step - loss: 0.5144 - acc: 0.7598
Epoch 14/500
891/891 [==============================] - 0s 103us/step - loss: 0.5082 - acc: 0.7576
Epoch 15/500
891/891 [==============================] - 0s 101us/step - loss: 0.5098 - acc: 0.7688
Epoch 16/500
891/891 [==============================] - 0s 101us/step - loss: 0.5058 - acc: 0.7744
Epoch 17/500
891/891 [==============================] - 0s 103us/step - loss: 0.4955 - acc: 0.7778
Epoch 18/500
891/891 [==============================] - 0s 102us/step - loss: 0.4958 - acc: 0.7722
Epoch 19/500
891/891 [==============================] - 0s 101us/step - loss: 0.4913 - acc: 0.7845
Epoch 20/500
891/891 [==============================] - 0s 100us/step - loss: 0.4887 - acc: 0.7755
Epoch 21/500
891/891 [==============================] - 0s 101us/step - loss: 0.4814 - acc: 0.7800
Epoch 22/500
891/891 [==============================] - 0s 105us/step - loss: 0.4809 - acc: 0.7800
Epoch 23/500
891/891 [==============================] - 0s 103us/step - loss: 0.4776 - acc: 0.7879
Epoch 24/500
891/891 [==============================] - 0s 101us/step - loss: 0.4709 - acc: 0.7868
Epoch 25/500
891/891 [==============================] - 0s 100us/step - loss: 0.4649 - acc: 0.7969
Epoch 26/500
891/891 [==============================] - 0s 101us/step - loss: 0.4671 - acc: 0.7834
Epoch 27/500
891/891 [==============================] - 0s 99us/step - loss: 0.4709 - acc: 0.7879
Epoch 28/500
891/891 [==============================] - 0s 102us/step - loss: 0.4673 - acc: 0.7935
Epoch 29/500
891/891 [==============================] - 0s 99us/step - loss: 0.4664 - acc: 0.7935
Epoch 30/500
891/891 [==============================] - 0s 100us/step - loss: 0.4658 - acc: 0.7912
Epoch 31/500
891/891 [==============================] - 0s 104us/step - loss: 0.4706 - acc: 0.7823
Epoch 32/500
891/891 [==============================] - 0s 102us/step - loss: 0.4625 - acc: 0.7890
Epoch 33/500
891/891 [==============================] - 0s 101us/step - loss: 0.4566 - acc: 0.7935
Epoch 34/500
891/891 [==============================] - 0s 99us/step - loss: 0.4468 - acc: 0.7980
Epoch 35/500
891/891 [==============================] - 0s 100us/step - loss: 0.4543 - acc: 0.7912
Epoch 36/500
891/891 [==============================] - 0s 100us/step - loss: 0.4483 - acc: 0.7980
Epoch 37/500
891/891 [==============================] - 0s 102us/step - loss: 0.4476 - acc: 0.8025
Epoch 38/500
891/891 [==============================] - 0s 100us/step - loss: 0.4470 - acc: 0.7935
Epoch 39/500
891/891 [==============================] - 0s 101us/step - loss: 0.4425 - acc: 0.7946
Epoch 40/500
891/891 [==============================] - 0s 99us/step - loss: 0.4530 - acc: 0.7957
Epoch 41/500
891/891 [==============================] - 0s 101us/step - loss: 0.4427 - acc: 0.7946
Epoch 42/500
891/891 [==============================] - 0s 101us/step - loss: 0.4406 - acc: 0.7980
Epoch 43/500
891/891 [==============================] - 0s 100us/step - loss: 0.4380 - acc: 0.8081
Epoch 44/500
891/891 [==============================] - 0s 100us/step - loss: 0.4409 - acc: 0.8036
Epoch 45/500
891/891 [==============================] - 0s 101us/step - loss: 0.4385 - acc: 0.7980
Epoch 46/500
891/891 [==============================] - 0s 100us/step - loss: 0.4370 - acc: 0.8047
Epoch 47/500
891/891 [==============================] - 0s 100us/step - loss: 0.4340 - acc: 0.8092
Epoch 48/500
891/891 [==============================] - 0s 102us/step - loss: 0.4350 - acc: 0.8070
Epoch 49/500
891/891 [==============================] - 0s 100us/step - loss: 0.4279 - acc: 0.8182
Epoch 50/500
891/891 [==============================] - 0s 101us/step - loss: 0.4402 - acc: 0.8013
Epoch 51/500
891/891 [==============================] - 0s 98us/step - loss: 0.4381 - acc: 0.8114
Epoch 52/500
891/891 [==============================] - 0s 100us/step - loss: 0.4401 - acc: 0.8013
Epoch 53/500
891/891 [==============================] - 0s 100us/step - loss: 0.4326 - acc: 0.8182
Epoch 54/500
891/891 [==============================] - 0s 99us/step - loss: 0.4233 - acc: 0.8036
Epoch 55/500
891/891 [==============================] - 0s 102us/step - loss: 0.4201 - acc: 0.8148
Epoch 56/500
891/891 [==============================] - 0s 102us/step - loss: 0.4206 - acc: 0.8227
Epoch 57/500
891/891 [==============================] - 0s 100us/step - loss: 0.4273 - acc: 0.8103
Epoch 58/500
891/891 [==============================] - 0s 99us/step - loss: 0.4233 - acc: 0.8114
Epoch 59/500
891/891 [==============================] - 0s 100us/step - loss: 0.4192 - acc: 0.8036
Epoch 60/500
891/891 [==============================] - 0s 108us/step - loss: 0.4146 - acc: 0.8227
Epoch 61/500
891/891 [==============================] - 0s 101us/step - loss: 0.4135 - acc: 0.8171
Epoch 62/500
891/891 [==============================] - 0s 103us/step - loss: 0.4181 - acc: 0.8137
Epoch 63/500
891/891 [==============================] - 0s 100us/step - loss: 0.4124 - acc: 0.8238
Epoch 64/500
891/891 [==============================] - 0s 101us/step - loss: 0.4178 - acc: 0.8137
Epoch 65/500
891/891 [==============================] - 0s 104us/step - loss: 0.4269 - acc: 0.8092
Epoch 66/500
891/891 [==============================] - 0s 101us/step - loss: 0.4165 - acc: 0.8137
Epoch 67/500
891/891 [==============================] - 0s 102us/step - loss: 0.4164 - acc: 0.8159
Epoch 68/500
891/891 [==============================] - 0s 101us/step - loss: 0.4370 - acc: 0.8002
Epoch 69/500
891/891 [==============================] - 0s 101us/step - loss: 0.4155 - acc: 0.8215
Epoch 70/500
891/891 [==============================] - 0s 101us/step - loss: 0.4162 - acc: 0.8092
Epoch 71/500
891/891 [==============================] - 0s 102us/step - loss: 0.4123 - acc: 0.8249
Epoch 72/500
891/891 [==============================] - 0s 100us/step - loss: 0.4146 - acc: 0.8148
Epoch 73/500
891/891 [==============================] - 0s 102us/step - loss: 0.4123 - acc: 0.8137
Epoch 74/500
891/891 [==============================] - 0s 101us/step - loss: 0.4104 - acc: 0.8227
Epoch 75/500
891/891 [==============================] - 0s 106us/step - loss: 0.4161 - acc: 0.8204
Epoch 76/500
891/891 [==============================] - 0s 109us/step - loss: 0.4051 - acc: 0.8260
Epoch 77/500
891/891 [==============================] - 0s 248us/step - loss: 0.4123 - acc: 0.8148
Epoch 78/500
891/891 [==============================] - 0s 162us/step - loss: 0.4056 - acc: 0.8227
Epoch 79/500
891/891 [==============================] - 0s 150us/step - loss: 0.4162 - acc: 0.8204
Epoch 80/500
891/891 [==============================] - 0s 207us/step - loss: 0.4149 - acc: 0.8070 0s - loss: 0.3930 - acc: 0.8
Epoch 81/500
891/891 [==============================] - 0s 154us/step - loss: 0.4207 - acc: 0.8126
Epoch 82/500
891/891 [==============================] - 0s 140us/step - loss: 0.4253 - acc: 0.7991
Epoch 83/500
891/891 [==============================] - 0s 140us/step - loss: 0.4045 - acc: 0.8204
Epoch 84/500
891/891 [==============================] - 0s 122us/step - loss: 0.4084 - acc: 0.8227
Epoch 85/500
891/891 [==============================] - 0s 118us/step - loss: 0.4073 - acc: 0.8260
Epoch 86/500
891/891 [==============================] - 0s 114us/step - loss: 0.4012 - acc: 0.8114
Epoch 87/500
891/891 [==============================] - 0s 114us/step - loss: 0.4032 - acc: 0.8215
Epoch 88/500
891/891 [==============================] - 0s 126us/step - loss: 0.4062 - acc: 0.8272
Epoch 89/500
891/891 [==============================] - 0s 124us/step - loss: 0.4016 - acc: 0.8305
Epoch 90/500
891/891 [==============================] - 0s 137us/step - loss: 0.4008 - acc: 0.8339
Epoch 91/500
891/891 [==============================] - 0s 131us/step - loss: 0.4119 - acc: 0.8249
Epoch 92/500
891/891 [==============================] - 0s 132us/step - loss: 0.4143 - acc: 0.8126
Epoch 93/500
891/891 [==============================] - 0s 129us/step - loss: 0.4037 - acc: 0.8238
Epoch 94/500
891/891 [==============================] - 0s 118us/step - loss: 0.4197 - acc: 0.8137
Epoch 95/500
891/891 [==============================] - 0s 127us/step - loss: 0.4036 - acc: 0.8260
Epoch 96/500
891/891 [==============================] - 0s 136us/step - loss: 0.4060 - acc: 0.8159
Epoch 97/500
891/891 [==============================] - 0s 119us/step - loss: 0.3987 - acc: 0.8283
Epoch 98/500
891/891 [==============================] - 0s 123us/step - loss: 0.4002 - acc: 0.8272
Epoch 99/500
891/891 [==============================] - 0s 117us/step - loss: 0.3998 - acc: 0.8260
Epoch 100/500
891/891 [==============================] - 0s 113us/step - loss: 0.4064 - acc: 0.8272
Epoch 101/500
891/891 [==============================] - 0s 117us/step - loss: 0.4082 - acc: 0.8305
Epoch 102/500
891/891 [==============================] - 0s 117us/step - loss: 0.4021 - acc: 0.8215
Epoch 103/500
891/891 [==============================] - 0s 131us/step - loss: 0.4016 - acc: 0.8294
Epoch 104/500
891/891 [==============================] - 0s 121us/step - loss: 0.3970 - acc: 0.8272
Epoch 105/500
891/891 [==============================] - 0s 125us/step - loss: 0.4010 - acc: 0.8328
Epoch 106/500
891/891 [==============================] - 0s 126us/step - loss: 0.4046 - acc: 0.8204
Epoch 107/500
891/891 [==============================] - 0s 185us/step - loss: 0.4058 - acc: 0.8305
Epoch 108/500
891/891 [==============================] - 0s 141us/step - loss: 0.4043 - acc: 0.8182
Epoch 109/500
891/891 [==============================] - 0s 144us/step - loss: 0.4128 - acc: 0.8182
Epoch 110/500
891/891 [==============================] - 0s 113us/step - loss: 0.4117 - acc: 0.8114
Epoch 111/500
891/891 [==============================] - 0s 138us/step - loss: 0.4078 - acc: 0.8137
Epoch 112/500
891/891 [==============================] - 0s 120us/step - loss: 0.4019 - acc: 0.8316
Epoch 113/500
891/891 [==============================] - 0s 110us/step - loss: 0.4105 - acc: 0.8249
Epoch 114/500
891/891 [==============================] - 0s 105us/step - loss: 0.4032 - acc: 0.8249
Epoch 115/500
891/891 [==============================] - 0s 111us/step - loss: 0.4047 - acc: 0.8238
Epoch 116/500
891/891 [==============================] - 0s 123us/step - loss: 0.4006 - acc: 0.8227
Epoch 117/500
891/891 [==============================] - 0s 121us/step - loss: 0.4088 - acc: 0.8137
Epoch 118/500
891/891 [==============================] - 0s 113us/step - loss: 0.4000 - acc: 0.8193
Epoch 119/500
891/891 [==============================] - 0s 101us/step - loss: 0.3994 - acc: 0.8272
Epoch 120/500
891/891 [==============================] - 0s 107us/step - loss: 0.3987 - acc: 0.8238
Epoch 121/500
891/891 [==============================] - 0s 129us/step - loss: 0.4067 - acc: 0.8238
Epoch 122/500
891/891 [==============================] - 0s 109us/step - loss: 0.3938 - acc: 0.8283
Epoch 123/500
891/891 [==============================] - 0s 124us/step - loss: 0.3934 - acc: 0.8328
Epoch 124/500
891/891 [==============================] - 0s 171us/step - loss: 0.3942 - acc: 0.8283
Epoch 125/500
891/891 [==============================] - 0s 171us/step - loss: 0.3935 - acc: 0.8305
Epoch 126/500
891/891 [==============================] - 0s 138us/step - loss: 0.3927 - acc: 0.8249
Epoch 127/500
891/891 [==============================] - 0s 138us/step - loss: 0.3950 - acc: 0.8283
Epoch 128/500
891/891 [==============================] - 0s 129us/step - loss: 0.3927 - acc: 0.8283
Epoch 129/500
891/891 [==============================] - 0s 181us/step - loss: 0.3968 - acc: 0.8294
Epoch 130/500
891/891 [==============================] - 0s 195us/step - loss: 0.4066 - acc: 0.8193
Epoch 131/500
891/891 [==============================] - 0s 146us/step - loss: 0.3932 - acc: 0.8350
Epoch 132/500
891/891 [==============================] - 0s 105us/step - loss: 0.4010 - acc: 0.8215
Epoch 133/500
891/891 [==============================] - 0s 122us/step - loss: 0.4011 - acc: 0.8215
Epoch 134/500
891/891 [==============================] - 0s 140us/step - loss: 0.4000 - acc: 0.8238
Epoch 135/500
891/891 [==============================] - 0s 102us/step - loss: 0.3948 - acc: 0.8350
Epoch 136/500
891/891 [==============================] - 0s 101us/step - loss: 0.3901 - acc: 0.8316
Epoch 137/500
891/891 [==============================] - 0s 104us/step - loss: 0.3883 - acc: 0.8305
Epoch 138/500
891/891 [==============================] - 0s 101us/step - loss: 0.3916 - acc: 0.8328
Epoch 139/500
891/891 [==============================] - 0s 101us/step - loss: 0.3941 - acc: 0.8272
Epoch 140/500
891/891 [==============================] - 0s 100us/step - loss: 0.3955 - acc: 0.8339
Epoch 141/500
891/891 [==============================] - 0s 113us/step - loss: 0.3899 - acc: 0.8373
Epoch 142/500
891/891 [==============================] - 0s 134us/step - loss: 0.4025 - acc: 0.8215
Epoch 143/500
891/891 [==============================] - 0s 102us/step - loss: 0.3956 - acc: 0.8316
Epoch 144/500
891/891 [==============================] - 0s 105us/step - loss: 0.3905 - acc: 0.8350
Epoch 145/500
891/891 [==============================] - 0s 117us/step - loss: 0.3965 - acc: 0.8328
Epoch 146/500
891/891 [==============================] - 0s 109us/step - loss: 0.4008 - acc: 0.8238
Epoch 147/500
891/891 [==============================] - 0s 106us/step - loss: 0.3900 - acc: 0.8350
Epoch 148/500
891/891 [==============================] - 0s 106us/step - loss: 0.3923 - acc: 0.8283
Epoch 149/500
891/891 [==============================] - 0s 122us/step - loss: 0.3925 - acc: 0.8373
Epoch 150/500
891/891 [==============================] - 0s 108us/step - loss: 0.3951 - acc: 0.8328
Epoch 151/500
891/891 [==============================] - 0s 100us/step - loss: 0.3909 - acc: 0.8294
Epoch 152/500
891/891 [==============================] - 0s 103us/step - loss: 0.3899 - acc: 0.8316
Epoch 153/500
891/891 [==============================] - 0s 101us/step - loss: 0.4003 - acc: 0.8238
Epoch 154/500
891/891 [==============================] - 0s 101us/step - loss: 0.3957 - acc: 0.8260
Epoch 155/500
891/891 [==============================] - 0s 102us/step - loss: 0.3940 - acc: 0.8305
Epoch 156/500
891/891 [==============================] - 0s 101us/step - loss: 0.3957 - acc: 0.8328
Epoch 157/500
891/891 [==============================] - 0s 103us/step - loss: 0.3890 - acc: 0.8350
Epoch 158/500
891/891 [==============================] - 0s 103us/step - loss: 0.3934 - acc: 0.8328
Epoch 159/500
891/891 [==============================] - 0s 100us/step - loss: 0.3956 - acc: 0.8249
Epoch 160/500
891/891 [==============================] - 0s 101us/step - loss: 0.3939 - acc: 0.8350
Epoch 161/500
891/891 [==============================] - 0s 101us/step - loss: 0.3905 - acc: 0.8260
Epoch 162/500
891/891 [==============================] - 0s 101us/step - loss: 0.3921 - acc: 0.8305
Epoch 163/500
891/891 [==============================] - 0s 103us/step - loss: 0.4053 - acc: 0.8272
Epoch 164/500
891/891 [==============================] - 0s 102us/step - loss: 0.3861 - acc: 0.8350
Epoch 165/500
891/891 [==============================] - 0s 101us/step - loss: 0.3959 - acc: 0.8272
Epoch 166/500
891/891 [==============================] - 0s 101us/step - loss: 0.3907 - acc: 0.8339
Epoch 167/500
891/891 [==============================] - 0s 101us/step - loss: 0.3865 - acc: 0.8339
Epoch 168/500
891/891 [==============================] - 0s 100us/step - loss: 0.3921 - acc: 0.8305
Epoch 169/500
891/891 [==============================] - 0s 103us/step - loss: 0.3984 - acc: 0.8294
Epoch 170/500
891/891 [==============================] - 0s 100us/step - loss: 0.3841 - acc: 0.8373
Epoch 171/500
891/891 [==============================] - 0s 101us/step - loss: 0.3893 - acc: 0.8294
Epoch 172/500
891/891 [==============================] - 0s 100us/step - loss: 0.3862 - acc: 0.8305
Epoch 173/500
891/891 [==============================] - 0s 100us/step - loss: 0.3863 - acc: 0.8316
Epoch 174/500
891/891 [==============================] - 0s 101us/step - loss: 0.3916 - acc: 0.8272
Epoch 175/500
891/891 [==============================] - 0s 103us/step - loss: 0.3936 - acc: 0.8350
Epoch 176/500
891/891 [==============================] - 0s 102us/step - loss: 0.3856 - acc: 0.8350
Epoch 177/500
891/891 [==============================] - 0s 127us/step - loss: 0.3971 - acc: 0.8294
Epoch 178/500
891/891 [==============================] - 0s 114us/step - loss: 0.3956 - acc: 0.8193
Epoch 179/500
891/891 [==============================] - 0s 174us/step - loss: 0.4138 - acc: 0.8103
Epoch 180/500
891/891 [==============================] - 0s 132us/step - loss: 0.4103 - acc: 0.8126
Epoch 181/500
891/891 [==============================] - 0s 125us/step - loss: 0.3924 - acc: 0.8249
Epoch 182/500
891/891 [==============================] - 0s 105us/step - loss: 0.3917 - acc: 0.8249
Epoch 183/500
891/891 [==============================] - 0s 141us/step - loss: 0.3817 - acc: 0.8384
Epoch 184/500
891/891 [==============================] - 0s 155us/step - loss: 0.3895 - acc: 0.8249
Epoch 185/500
891/891 [==============================] - 0s 107us/step - loss: 0.3837 - acc: 0.8316
Epoch 186/500
891/891 [==============================] - 0s 106us/step - loss: 0.3810 - acc: 0.8384
Epoch 187/500
891/891 [==============================] - 0s 101us/step - loss: 0.3858 - acc: 0.8350
Epoch 188/500
891/891 [==============================] - 0s 102us/step - loss: 0.3807 - acc: 0.8305
Epoch 189/500
891/891 [==============================] - 0s 101us/step - loss: 0.3849 - acc: 0.8316
Epoch 190/500
891/891 [==============================] - 0s 100us/step - loss: 0.3837 - acc: 0.8350
Epoch 191/500
891/891 [==============================] - 0s 158us/step - loss: 0.4047 - acc: 0.8249
Epoch 192/500
891/891 [==============================] - 0s 150us/step - loss: 0.4004 - acc: 0.8238
Epoch 193/500
891/891 [==============================] - 0s 146us/step - loss: 0.3881 - acc: 0.8294
Epoch 194/500
891/891 [==============================] - 0s 181us/step - loss: 0.3843 - acc: 0.8384
Epoch 195/500
891/891 [==============================] - 0s 119us/step - loss: 0.3910 - acc: 0.8395
Epoch 196/500
891/891 [==============================] - 0s 115us/step - loss: 0.3845 - acc: 0.8350
Epoch 197/500
891/891 [==============================] - 0s 179us/step - loss: 0.3915 - acc: 0.8283
Epoch 198/500
891/891 [==============================] - 0s 135us/step - loss: 0.3850 - acc: 0.8294
Epoch 199/500
891/891 [==============================] - 0s 159us/step - loss: 0.3944 - acc: 0.8215
Epoch 200/500
891/891 [==============================] - 0s 161us/step - loss: 0.3871 - acc: 0.8316
Epoch 201/500
891/891 [==============================] - 0s 151us/step - loss: 0.3818 - acc: 0.8305
Epoch 202/500
891/891 [==============================] - 0s 139us/step - loss: 0.3787 - acc: 0.8406
Epoch 203/500
891/891 [==============================] - 0s 118us/step - loss: 0.3812 - acc: 0.8361
Epoch 204/500
891/891 [==============================] - 0s 129us/step - loss: 0.3870 - acc: 0.8305
Epoch 205/500
891/891 [==============================] - 0s 167us/step - loss: 0.3859 - acc: 0.8294
Epoch 206/500
891/891 [==============================] - 0s 154us/step - loss: 0.3968 - acc: 0.8249
Epoch 207/500
891/891 [==============================] - 0s 114us/step - loss: 0.3888 - acc: 0.8350
Epoch 208/500
891/891 [==============================] - 0s 109us/step - loss: 0.3787 - acc: 0.8429
Epoch 209/500
891/891 [==============================] - 0s 120us/step - loss: 0.3839 - acc: 0.8350
Epoch 210/500
891/891 [==============================] - 0s 119us/step - loss: 0.3906 - acc: 0.8283
Epoch 211/500
891/891 [==============================] - 0s 118us/step - loss: 0.3887 - acc: 0.8361
Epoch 212/500
891/891 [==============================] - 0s 125us/step - loss: 0.3872 - acc: 0.8294
Epoch 213/500
891/891 [==============================] - 0s 116us/step - loss: 0.3909 - acc: 0.8350
Epoch 214/500
891/891 [==============================] - 0s 120us/step - loss: 0.3852 - acc: 0.8238
Epoch 215/500
891/891 [==============================] - 0s 116us/step - loss: 0.3933 - acc: 0.8316
Epoch 216/500
891/891 [==============================] - 0s 118us/step - loss: 0.3812 - acc: 0.8361
Epoch 217/500
891/891 [==============================] - 0s 159us/step - loss: 0.3821 - acc: 0.8384
Epoch 218/500
891/891 [==============================] - 0s 143us/step - loss: 0.3871 - acc: 0.8373
Epoch 219/500
891/891 [==============================] - 0s 141us/step - loss: 0.3823 - acc: 0.8316
Epoch 220/500
891/891 [==============================] - 0s 142us/step - loss: 0.3822 - acc: 0.8361 0s - loss: 0.4078 - acc: 0.82
Epoch 221/500
891/891 [==============================] - 0s 138us/step - loss: 0.3782 - acc: 0.8384
Epoch 222/500
891/891 [==============================] - 0s 151us/step - loss: 0.3843 - acc: 0.8350
Epoch 223/500
891/891 [==============================] - 0s 152us/step - loss: 0.3924 - acc: 0.8249
Epoch 224/500
891/891 [==============================] - 0s 151us/step - loss: 0.3834 - acc: 0.8339
Epoch 225/500
891/891 [==============================] - 0s 134us/step - loss: 0.3864 - acc: 0.8283
Epoch 226/500
891/891 [==============================] - 0s 129us/step - loss: 0.3902 - acc: 0.8272
Epoch 227/500
891/891 [==============================] - 0s 111us/step - loss: 0.3854 - acc: 0.8361
Epoch 228/500
891/891 [==============================] - 0s 106us/step - loss: 0.3810 - acc: 0.8373
Epoch 229/500
891/891 [==============================] - 0s 103us/step - loss: 0.3941 - acc: 0.8260
Epoch 230/500
891/891 [==============================] - 0s 103us/step - loss: 0.3791 - acc: 0.8361
Epoch 231/500
891/891 [==============================] - 0s 103us/step - loss: 0.3813 - acc: 0.8373
Epoch 232/500
891/891 [==============================] - 0s 102us/step - loss: 0.3749 - acc: 0.8384
Epoch 233/500
891/891 [==============================] - 0s 104us/step - loss: 0.3795 - acc: 0.8361
Epoch 234/500
891/891 [==============================] - 0s 103us/step - loss: 0.3837 - acc: 0.8339
Epoch 235/500
891/891 [==============================] - 0s 104us/step - loss: 0.3723 - acc: 0.8429
Epoch 236/500
891/891 [==============================] - 0s 103us/step - loss: 0.3839 - acc: 0.8395
Epoch 237/500
891/891 [==============================] - 0s 102us/step - loss: 0.3920 - acc: 0.8272
Epoch 238/500
891/891 [==============================] - 0s 103us/step - loss: 0.3871 - acc: 0.8361
Epoch 239/500
891/891 [==============================] - 0s 103us/step - loss: 0.3850 - acc: 0.8373
Epoch 240/500
891/891 [==============================] - 0s 102us/step - loss: 0.3799 - acc: 0.8406
Epoch 241/500
891/891 [==============================] - 0s 104us/step - loss: 0.3863 - acc: 0.8316
Epoch 242/500
891/891 [==============================] - 0s 103us/step - loss: 0.3921 - acc: 0.8238
Epoch 243/500
891/891 [==============================] - 0s 104us/step - loss: 0.3898 - acc: 0.8305
Epoch 244/500
891/891 [==============================] - 0s 125us/step - loss: 0.3824 - acc: 0.8406
Epoch 245/500
891/891 [==============================] - 0s 154us/step - loss: 0.3805 - acc: 0.8395
Epoch 246/500
891/891 [==============================] - 0s 140us/step - loss: 0.3822 - acc: 0.8350
Epoch 247/500
891/891 [==============================] - 0s 132us/step - loss: 0.3798 - acc: 0.8373
Epoch 248/500
891/891 [==============================] - 0s 122us/step - loss: 0.3785 - acc: 0.8395
Epoch 249/500
891/891 [==============================] - 0s 150us/step - loss: 0.3771 - acc: 0.8418
Epoch 250/500
891/891 [==============================] - 0s 140us/step - loss: 0.3750 - acc: 0.8384
Epoch 251/500
891/891 [==============================] - 0s 130us/step - loss: 0.3783 - acc: 0.8361
Epoch 252/500
891/891 [==============================] - 0s 139us/step - loss: 0.3748 - acc: 0.8418
Epoch 253/500
891/891 [==============================] - 0s 139us/step - loss: 0.3743 - acc: 0.8395
Epoch 254/500
891/891 [==============================] - 0s 149us/step - loss: 0.3719 - acc: 0.8462
Epoch 255/500
891/891 [==============================] - 0s 128us/step - loss: 0.3773 - acc: 0.8361
Epoch 256/500
891/891 [==============================] - 0s 134us/step - loss: 0.3798 - acc: 0.8384
Epoch 257/500
891/891 [==============================] - 0s 113us/step - loss: 0.3749 - acc: 0.8451
Epoch 258/500
891/891 [==============================] - 0s 117us/step - loss: 0.3872 - acc: 0.8350
Epoch 259/500
891/891 [==============================] - 0s 110us/step - loss: 0.3833 - acc: 0.8350
Epoch 260/500
891/891 [==============================] - 0s 127us/step - loss: 0.3823 - acc: 0.8373
Epoch 261/500
891/891 [==============================] - 0s 145us/step - loss: 0.3815 - acc: 0.8361
Epoch 262/500
891/891 [==============================] - 0s 124us/step - loss: 0.3842 - acc: 0.8373
Epoch 263/500
891/891 [==============================] - 0s 118us/step - loss: 0.3884 - acc: 0.8283
Epoch 264/500
891/891 [==============================] - 0s 133us/step - loss: 0.3819 - acc: 0.8361
Epoch 265/500
891/891 [==============================] - 0s 112us/step - loss: 0.3822 - acc: 0.8373
Epoch 266/500
891/891 [==============================] - 0s 113us/step - loss: 0.3895 - acc: 0.8328
Epoch 267/500
891/891 [==============================] - 0s 113us/step - loss: 0.3838 - acc: 0.8361
Epoch 268/500
891/891 [==============================] - 0s 115us/step - loss: 0.3800 - acc: 0.8395
Epoch 269/500
891/891 [==============================] - 0s 133us/step - loss: 0.3810 - acc: 0.8339
Epoch 270/500
891/891 [==============================] - 0s 133us/step - loss: 0.3788 - acc: 0.8418
Epoch 271/500
891/891 [==============================] - 0s 112us/step - loss: 0.3789 - acc: 0.8418
Epoch 272/500
891/891 [==============================] - 0s 138us/step - loss: 0.3799 - acc: 0.8418
Epoch 273/500
891/891 [==============================] - 0s 158us/step - loss: 0.3820 - acc: 0.8429
Epoch 274/500
891/891 [==============================] - 0s 109us/step - loss: 0.3889 - acc: 0.8249
Epoch 275/500
891/891 [==============================] - 0s 98us/step - loss: 0.3925 - acc: 0.8137
Epoch 276/500
891/891 [==============================] - 0s 102us/step - loss: 0.3805 - acc: 0.8373
Epoch 277/500
891/891 [==============================] - 0s 104us/step - loss: 0.3763 - acc: 0.8440
Epoch 278/500
891/891 [==============================] - 0s 105us/step - loss: 0.3801 - acc: 0.8339
Epoch 279/500
891/891 [==============================] - 0s 104us/step - loss: 0.3823 - acc: 0.8373
Epoch 280/500
891/891 [==============================] - 0s 103us/step - loss: 0.3904 - acc: 0.8294
Epoch 281/500
891/891 [==============================] - 0s 103us/step - loss: 0.3774 - acc: 0.8395
Epoch 282/500
891/891 [==============================] - 0s 103us/step - loss: 0.3805 - acc: 0.8350
Epoch 283/500
891/891 [==============================] - 0s 111us/step - loss: 0.3875 - acc: 0.8339
Epoch 284/500
891/891 [==============================] - 0s 108us/step - loss: 0.3751 - acc: 0.8429
Epoch 285/500
891/891 [==============================] - 0s 101us/step - loss: 0.3745 - acc: 0.8395
Epoch 286/500
891/891 [==============================] - 0s 102us/step - loss: 0.3816 - acc: 0.8384
Epoch 287/500
891/891 [==============================] - 0s 100us/step - loss: 0.3809 - acc: 0.8373
Epoch 288/500
891/891 [==============================] - 0s 102us/step - loss: 0.3770 - acc: 0.8440
Epoch 289/500
891/891 [==============================] - 0s 102us/step - loss: 0.3748 - acc: 0.8429
Epoch 290/500
891/891 [==============================] - 0s 100us/step - loss: 0.3713 - acc: 0.8429
Epoch 291/500
891/891 [==============================] - 0s 103us/step - loss: 0.3718 - acc: 0.8418
Epoch 292/500
891/891 [==============================] - 0s 104us/step - loss: 0.3734 - acc: 0.8485
Epoch 293/500
891/891 [==============================] - 0s 104us/step - loss: 0.3741 - acc: 0.8406
Epoch 294/500
891/891 [==============================] - 0s 118us/step - loss: 0.3706 - acc: 0.8440
Epoch 295/500
891/891 [==============================] - 0s 101us/step - loss: 0.3740 - acc: 0.8429
Epoch 296/500
891/891 [==============================] - 0s 103us/step - loss: 0.3847 - acc: 0.8328
Epoch 297/500
891/891 [==============================] - 0s 103us/step - loss: 0.3889 - acc: 0.8361
Epoch 298/500
891/891 [==============================] - 0s 105us/step - loss: 0.3943 - acc: 0.8283
Epoch 299/500
891/891 [==============================] - 0s 103us/step - loss: 0.3887 - acc: 0.8227
Epoch 300/500
891/891 [==============================] - 0s 103us/step - loss: 0.3917 - acc: 0.8328
Epoch 301/500
891/891 [==============================] - 0s 103us/step - loss: 0.3882 - acc: 0.8328
Epoch 302/500
891/891 [==============================] - 0s 101us/step - loss: 0.3812 - acc: 0.8316
Epoch 303/500
891/891 [==============================] - 0s 105us/step - loss: 0.3806 - acc: 0.8418
Epoch 304/500
891/891 [==============================] - 0s 103us/step - loss: 0.3784 - acc: 0.8395
Epoch 305/500
891/891 [==============================] - 0s 102us/step - loss: 0.3777 - acc: 0.8406
Epoch 306/500
891/891 [==============================] - 0s 103us/step - loss: 0.3799 - acc: 0.8395
Epoch 307/500
891/891 [==============================] - 0s 102us/step - loss: 0.3765 - acc: 0.8384
Epoch 308/500
891/891 [==============================] - 0s 102us/step - loss: 0.3757 - acc: 0.8406
Epoch 309/500
891/891 [==============================] - 0s 102us/step - loss: 0.3789 - acc: 0.8373
Epoch 310/500
891/891 [==============================] - 0s 104us/step - loss: 0.3783 - acc: 0.8395
Epoch 311/500
891/891 [==============================] - 0s 101us/step - loss: 0.3813 - acc: 0.8395
Epoch 312/500
891/891 [==============================] - 0s 102us/step - loss: 0.3801 - acc: 0.8395
Epoch 313/500
891/891 [==============================] - 0s 103us/step - loss: 0.3785 - acc: 0.8406
Epoch 314/500
891/891 [==============================] - 0s 102us/step - loss: 0.3750 - acc: 0.8406
Epoch 315/500
891/891 [==============================] - 0s 105us/step - loss: 0.3749 - acc: 0.8384
Epoch 316/500
891/891 [==============================] - 0s 104us/step - loss: 0.3753 - acc: 0.8429
Epoch 317/500
891/891 [==============================] - 0s 104us/step - loss: 0.3746 - acc: 0.8418
Epoch 318/500
891/891 [==============================] - 0s 101us/step - loss: 0.3835 - acc: 0.8316
Epoch 319/500
891/891 [==============================] - 0s 102us/step - loss: 0.3917 - acc: 0.8373
Epoch 320/500
891/891 [==============================] - 0s 102us/step - loss: 0.3830 - acc: 0.8384
Epoch 321/500
891/891 [==============================] - 0s 103us/step - loss: 0.3759 - acc: 0.8418
Epoch 322/500
891/891 [==============================] - 0s 102us/step - loss: 0.3741 - acc: 0.8440
Epoch 323/500
891/891 [==============================] - 0s 104us/step - loss: 0.3757 - acc: 0.8418
Epoch 324/500
891/891 [==============================] - 0s 104us/step - loss: 0.3745 - acc: 0.8440
Epoch 325/500
891/891 [==============================] - 0s 104us/step - loss: 0.3776 - acc: 0.8361
Epoch 326/500
891/891 [==============================] - 0s 104us/step - loss: 0.3781 - acc: 0.8350
Epoch 327/500
891/891 [==============================] - 0s 104us/step - loss: 0.3867 - acc: 0.8294
Epoch 328/500
891/891 [==============================] - 0s 104us/step - loss: 0.3849 - acc: 0.8406
Epoch 329/500
891/891 [==============================] - 0s 102us/step - loss: 0.3787 - acc: 0.8429
Epoch 330/500
891/891 [==============================] - 0s 102us/step - loss: 0.3761 - acc: 0.8474
Epoch 331/500
891/891 [==============================] - 0s 109us/step - loss: 0.3735 - acc: 0.8406
Epoch 332/500
891/891 [==============================] - 0s 104us/step - loss: 0.3784 - acc: 0.8361
Epoch 333/500
891/891 [==============================] - 0s 102us/step - loss: 0.3751 - acc: 0.8451
Epoch 334/500
891/891 [==============================] - 0s 102us/step - loss: 0.3817 - acc: 0.8339
Epoch 335/500
891/891 [==============================] - 0s 103us/step - loss: 0.3702 - acc: 0.8451
Epoch 336/500
891/891 [==============================] - 0s 102us/step - loss: 0.3936 - acc: 0.8249
Epoch 337/500
891/891 [==============================] - 0s 103us/step - loss: 0.3918 - acc: 0.8384
Epoch 338/500
891/891 [==============================] - 0s 101us/step - loss: 0.3805 - acc: 0.8418
Epoch 339/500
891/891 [==============================] - 0s 101us/step - loss: 0.3781 - acc: 0.8406
Epoch 340/500
891/891 [==============================] - 0s 102us/step - loss: 0.3778 - acc: 0.8451
Epoch 341/500
891/891 [==============================] - 0s 102us/step - loss: 0.3732 - acc: 0.8485
Epoch 342/500
891/891 [==============================] - 0s 101us/step - loss: 0.3714 - acc: 0.8440
Epoch 343/500
891/891 [==============================] - 0s 103us/step - loss: 0.3756 - acc: 0.8406
Epoch 344/500
891/891 [==============================] - 0s 102us/step - loss: 0.3812 - acc: 0.8305
Epoch 345/500
891/891 [==============================] - 0s 102us/step - loss: 0.3768 - acc: 0.8462
Epoch 346/500
891/891 [==============================] - 0s 102us/step - loss: 0.3757 - acc: 0.8462
Epoch 347/500
891/891 [==============================] - 0s 102us/step - loss: 0.3764 - acc: 0.8429
Epoch 348/500
891/891 [==============================] - 0s 102us/step - loss: 0.3790 - acc: 0.8451
Epoch 349/500
891/891 [==============================] - 0s 102us/step - loss: 0.3778 - acc: 0.8418
Epoch 350/500
891/891 [==============================] - 0s 101us/step - loss: 0.3789 - acc: 0.8384
Epoch 351/500
891/891 [==============================] - 0s 102us/step - loss: 0.3788 - acc: 0.8373
Epoch 352/500
891/891 [==============================] - 0s 102us/step - loss: 0.3760 - acc: 0.8451
Epoch 353/500
891/891 [==============================] - 0s 101us/step - loss: 0.3797 - acc: 0.8462
Epoch 354/500
891/891 [==============================] - 0s 104us/step - loss: 0.3814 - acc: 0.8350
Epoch 355/500
891/891 [==============================] - 0s 100us/step - loss: 0.3764 - acc: 0.8451
Epoch 356/500
891/891 [==============================] - 0s 103us/step - loss: 0.3712 - acc: 0.8451
Epoch 357/500
891/891 [==============================] - 0s 102us/step - loss: 0.3696 - acc: 0.8462
Epoch 358/500
891/891 [==============================] - 0s 101us/step - loss: 0.3740 - acc: 0.8462
Epoch 359/500
891/891 [==============================] - 0s 104us/step - loss: 0.3807 - acc: 0.8451
Epoch 360/500
891/891 [==============================] - 0s 103us/step - loss: 0.3766 - acc: 0.8395
Epoch 361/500
891/891 [==============================] - 0s 101us/step - loss: 0.3760 - acc: 0.8395
Epoch 362/500
891/891 [==============================] - 0s 103us/step - loss: 0.3882 - acc: 0.8328
Epoch 363/500
891/891 [==============================] - 0s 102us/step - loss: 0.3844 - acc: 0.8406
Epoch 364/500
891/891 [==============================] - 0s 102us/step - loss: 0.3754 - acc: 0.8395
Epoch 365/500
891/891 [==============================] - 0s 148us/step - loss: 0.3776 - acc: 0.8451
Epoch 366/500
891/891 [==============================] - 0s 181us/step - loss: 0.3837 - acc: 0.8384
Epoch 367/500
891/891 [==============================] - 0s 154us/step - loss: 0.3876 - acc: 0.8328
Epoch 368/500
891/891 [==============================] - 0s 157us/step - loss: 0.3832 - acc: 0.8361 0s - loss: 0.3869 - acc: 0.83
Epoch 369/500
891/891 [==============================] - 0s 148us/step - loss: 0.3748 - acc: 0.8418
Epoch 370/500
891/891 [==============================] - 0s 150us/step - loss: 0.3737 - acc: 0.8440
Epoch 371/500
891/891 [==============================] - 0s 141us/step - loss: 0.3711 - acc: 0.8440
Epoch 372/500
891/891 [==============================] - 0s 107us/step - loss: 0.3748 - acc: 0.8462
Epoch 373/500
891/891 [==============================] - 0s 101us/step - loss: 0.3739 - acc: 0.8395
Epoch 374/500
891/891 [==============================] - 0s 102us/step - loss: 0.3803 - acc: 0.8350
Epoch 375/500
891/891 [==============================] - 0s 103us/step - loss: 0.3846 - acc: 0.8350
Epoch 376/500
891/891 [==============================] - 0s 101us/step - loss: 0.3767 - acc: 0.8305
Epoch 377/500
891/891 [==============================] - 0s 104us/step - loss: 0.3921 - acc: 0.8373
Epoch 378/500
891/891 [==============================] - 0s 109us/step - loss: 0.3786 - acc: 0.8418
Epoch 379/500
891/891 [==============================] - 0s 135us/step - loss: 0.3743 - acc: 0.8440
Epoch 380/500
891/891 [==============================] - 0s 154us/step - loss: 0.3701 - acc: 0.8440
Epoch 381/500
891/891 [==============================] - 0s 167us/step - loss: 0.3712 - acc: 0.8440
Epoch 382/500
891/891 [==============================] - 0s 122us/step - loss: 0.3716 - acc: 0.8418
Epoch 383/500
891/891 [==============================] - 0s 103us/step - loss: 0.3700 - acc: 0.8507
Epoch 384/500
891/891 [==============================] - 0s 104us/step - loss: 0.3689 - acc: 0.8361
Epoch 385/500
891/891 [==============================] - 0s 101us/step - loss: 0.3804 - acc: 0.8339
Epoch 386/500
891/891 [==============================] - 0s 101us/step - loss: 0.3764 - acc: 0.8451
Epoch 387/500
891/891 [==============================] - 0s 102us/step - loss: 0.3725 - acc: 0.8451
Epoch 388/500
891/891 [==============================] - 0s 110us/step - loss: 0.3747 - acc: 0.8384
Epoch 389/500
891/891 [==============================] - 0s 108us/step - loss: 0.3753 - acc: 0.8485
Epoch 390/500
891/891 [==============================] - 0s 106us/step - loss: 0.3803 - acc: 0.8361
Epoch 391/500
891/891 [==============================] - 0s 101us/step - loss: 0.3738 - acc: 0.8440
Epoch 392/500
891/891 [==============================] - 0s 112us/step - loss: 0.3899 - acc: 0.8215
Epoch 393/500
891/891 [==============================] - 0s 100us/step - loss: 0.3964 - acc: 0.8328
Epoch 394/500
891/891 [==============================] - 0s 101us/step - loss: 0.3731 - acc: 0.8451
Epoch 395/500
891/891 [==============================] - 0s 100us/step - loss: 0.3696 - acc: 0.8462
Epoch 396/500
891/891 [==============================] - 0s 104us/step - loss: 0.3766 - acc: 0.8451
Epoch 397/500
891/891 [==============================] - 0s 101us/step - loss: 0.3683 - acc: 0.8474
Epoch 398/500
891/891 [==============================] - 0s 102us/step - loss: 0.3788 - acc: 0.8418
Epoch 399/500
891/891 [==============================] - 0s 104us/step - loss: 0.3893 - acc: 0.8373
Epoch 400/500
891/891 [==============================] - 0s 113us/step - loss: 0.3720 - acc: 0.8451
Epoch 401/500
891/891 [==============================] - 0s 150us/step - loss: 0.3691 - acc: 0.8507
Epoch 402/500
891/891 [==============================] - 0s 153us/step - loss: 0.3682 - acc: 0.8462
Epoch 403/500
891/891 [==============================] - 0s 154us/step - loss: 0.3894 - acc: 0.8305
Epoch 404/500
891/891 [==============================] - 0s 130us/step - loss: 0.3969 - acc: 0.8283
Epoch 405/500
891/891 [==============================] - 0s 104us/step - loss: 0.3782 - acc: 0.8474
Epoch 406/500
891/891 [==============================] - 0s 104us/step - loss: 0.3787 - acc: 0.8429
Epoch 407/500
891/891 [==============================] - 0s 104us/step - loss: 0.3667 - acc: 0.8519
Epoch 408/500
891/891 [==============================] - 0s 102us/step - loss: 0.3885 - acc: 0.8384
Epoch 409/500
891/891 [==============================] - 0s 148us/step - loss: 0.3700 - acc: 0.8462
Epoch 410/500
891/891 [==============================] - 0s 158us/step - loss: 0.3858 - acc: 0.8406
Epoch 411/500
891/891 [==============================] - 0s 155us/step - loss: 0.3660 - acc: 0.8451
Epoch 412/500
891/891 [==============================] - 0s 129us/step - loss: 0.3645 - acc: 0.8541
Epoch 413/500
891/891 [==============================] - 0s 105us/step - loss: 0.3601 - acc: 0.8496
Epoch 414/500
891/891 [==============================] - 0s 101us/step - loss: 0.3735 - acc: 0.8485
Epoch 415/500
891/891 [==============================] - 0s 105us/step - loss: 0.3613 - acc: 0.8530
Epoch 416/500
891/891 [==============================] - 0s 102us/step - loss: 0.3610 - acc: 0.8541
Epoch 417/500
891/891 [==============================] - 0s 101us/step - loss: 0.3802 - acc: 0.8406
Epoch 418/500
891/891 [==============================] - 0s 107us/step - loss: 0.3854 - acc: 0.8418
Epoch 419/500
891/891 [==============================] - 0s 109us/step - loss: 0.3691 - acc: 0.8485
Epoch 420/500
891/891 [==============================] - 0s 109us/step - loss: 0.3797 - acc: 0.8462
Epoch 421/500
891/891 [==============================] - 0s 105us/step - loss: 0.3704 - acc: 0.8474
Epoch 422/500
891/891 [==============================] - 0s 115us/step - loss: 0.3741 - acc: 0.8474
Epoch 423/500
891/891 [==============================] - 0s 144us/step - loss: 0.3715 - acc: 0.8507
Epoch 424/500
891/891 [==============================] - 0s 152us/step - loss: 0.3662 - acc: 0.8496
Epoch 425/500
891/891 [==============================] - 0s 150us/step - loss: 0.3733 - acc: 0.8451
Epoch 426/500
891/891 [==============================] - 0s 111us/step - loss: 0.3766 - acc: 0.8384
Epoch 427/500
891/891 [==============================] - 0s 101us/step - loss: 0.3877 - acc: 0.8350
Epoch 428/500
891/891 [==============================] - 0s 105us/step - loss: 0.3729 - acc: 0.8474
Epoch 429/500
891/891 [==============================] - 0s 101us/step - loss: 0.3612 - acc: 0.8541
Epoch 430/500
891/891 [==============================] - 0s 103us/step - loss: 0.3705 - acc: 0.8496
Epoch 431/500
891/891 [==============================] - 0s 108us/step - loss: 0.3620 - acc: 0.8530
Epoch 432/500
891/891 [==============================] - 0s 111us/step - loss: 0.3601 - acc: 0.8485
Epoch 433/500
891/891 [==============================] - 0s 114us/step - loss: 0.3639 - acc: 0.8507
Epoch 434/500
891/891 [==============================] - 0s 107us/step - loss: 0.3570 - acc: 0.8507
Epoch 435/500
891/891 [==============================] - 0s 103us/step - loss: 0.3643 - acc: 0.8474
Epoch 436/500
891/891 [==============================] - 0s 103us/step - loss: 0.3962 - acc: 0.8305
Epoch 437/500
891/891 [==============================] - 0s 101us/step - loss: 0.3680 - acc: 0.8395
Epoch 438/500
891/891 [==============================] - 0s 107us/step - loss: 0.3607 - acc: 0.8541
Epoch 439/500
891/891 [==============================] - 0s 141us/step - loss: 0.3653 - acc: 0.8418
Epoch 440/500
891/891 [==============================] - 0s 159us/step - loss: 0.3704 - acc: 0.8474
Epoch 441/500
891/891 [==============================] - 0s 146us/step - loss: 0.3649 - acc: 0.8451
Epoch 442/500
891/891 [==============================] - 0s 153us/step - loss: 0.3752 - acc: 0.8474
Epoch 443/500
891/891 [==============================] - 0s 108us/step - loss: 0.3682 - acc: 0.8507
Epoch 444/500
891/891 [==============================] - 0s 101us/step - loss: 0.3730 - acc: 0.8451
Epoch 445/500
891/891 [==============================] - 0s 103us/step - loss: 0.3767 - acc: 0.8429
Epoch 446/500
891/891 [==============================] - 0s 103us/step - loss: 0.3779 - acc: 0.8350
Epoch 447/500
891/891 [==============================] - 0s 103us/step - loss: 0.3645 - acc: 0.8440
Epoch 448/500
891/891 [==============================] - 0s 106us/step - loss: 0.3731 - acc: 0.8440
Epoch 449/500
891/891 [==============================] - 0s 107us/step - loss: 0.3651 - acc: 0.8440
Epoch 450/500
891/891 [==============================] - 0s 111us/step - loss: 0.3624 - acc: 0.8519
Epoch 451/500
891/891 [==============================] - 0s 112us/step - loss: 0.3630 - acc: 0.8519
Epoch 452/500
891/891 [==============================] - 0s 144us/step - loss: 0.3654 - acc: 0.8507
Epoch 453/500
891/891 [==============================] - 0s 150us/step - loss: 0.3641 - acc: 0.8519
Epoch 454/500
891/891 [==============================] - 0s 146us/step - loss: 0.3597 - acc: 0.8496
Epoch 455/500
891/891 [==============================] - 0s 134us/step - loss: 0.3619 - acc: 0.8462
Epoch 456/500
891/891 [==============================] - 0s 103us/step - loss: 0.3614 - acc: 0.8541
Epoch 457/500
891/891 [==============================] - 0s 101us/step - loss: 0.3719 - acc: 0.8395
Epoch 458/500
891/891 [==============================] - 0s 102us/step - loss: 0.3704 - acc: 0.8440
Epoch 459/500
891/891 [==============================] - 0s 119us/step - loss: 0.3602 - acc: 0.8474
Epoch 460/500
891/891 [==============================] - 0s 107us/step - loss: 0.3560 - acc: 0.8563
Epoch 461/500
891/891 [==============================] - 0s 116us/step - loss: 0.3593 - acc: 0.8541
Epoch 462/500
891/891 [==============================] - 0s 115us/step - loss: 0.3607 - acc: 0.8552
Epoch 463/500
891/891 [==============================] - 0s 109us/step - loss: 0.3703 - acc: 0.8485
Epoch 464/500
891/891 [==============================] - 0s 103us/step - loss: 0.3620 - acc: 0.8451
Epoch 465/500
891/891 [==============================] - 0s 101us/step - loss: 0.3743 - acc: 0.8384
Epoch 466/500
891/891 [==============================] - 0s 102us/step - loss: 0.3733 - acc: 0.8418
Epoch 467/500
891/891 [==============================] - 0s 101us/step - loss: 0.3641 - acc: 0.8507
Epoch 468/500
891/891 [==============================] - 0s 101us/step - loss: 0.3611 - acc: 0.8507
Epoch 469/500
891/891 [==============================] - 0s 100us/step - loss: 0.3612 - acc: 0.8496
Epoch 470/500
891/891 [==============================] - 0s 101us/step - loss: 0.3664 - acc: 0.8496
Epoch 471/500
891/891 [==============================] - 0s 99us/step - loss: 0.3634 - acc: 0.8530
Epoch 472/500
891/891 [==============================] - 0s 101us/step - loss: 0.3620 - acc: 0.8429
Epoch 473/500
891/891 [==============================] - 0s 103us/step - loss: 0.3762 - acc: 0.8485
Epoch 474/500
891/891 [==============================] - 0s 104us/step - loss: 0.3779 - acc: 0.8462
Epoch 475/500
891/891 [==============================] - 0s 104us/step - loss: 0.3887 - acc: 0.8339
Epoch 476/500
891/891 [==============================] - 0s 103us/step - loss: 0.3713 - acc: 0.8440
Epoch 477/500
891/891 [==============================] - 0s 103us/step - loss: 0.3673 - acc: 0.8474
Epoch 478/500
891/891 [==============================] - 0s 101us/step - loss: 0.3629 - acc: 0.8507
Epoch 479/500
891/891 [==============================] - 0s 101us/step - loss: 0.3648 - acc: 0.8496
Epoch 480/500
891/891 [==============================] - 0s 101us/step - loss: 0.3668 - acc: 0.8485
Epoch 481/500
891/891 [==============================] - 0s 102us/step - loss: 0.3651 - acc: 0.8519
Epoch 482/500
891/891 [==============================] - 0s 105us/step - loss: 0.3698 - acc: 0.8519
Epoch 483/500
891/891 [==============================] - 0s 103us/step - loss: 0.3829 - acc: 0.8305
Epoch 484/500
891/891 [==============================] - 0s 102us/step - loss: 0.3750 - acc: 0.8384
Epoch 485/500
891/891 [==============================] - 0s 103us/step - loss: 0.3772 - acc: 0.8462
Epoch 486/500
891/891 [==============================] - 0s 101us/step - loss: 0.3677 - acc: 0.8429
Epoch 487/500
891/891 [==============================] - 0s 104us/step - loss: 0.3751 - acc: 0.8204
Epoch 488/500
891/891 [==============================] - 0s 113us/step - loss: 0.3877 - acc: 0.8328
Epoch 489/500
891/891 [==============================] - 0s 144us/step - loss: 0.3678 - acc: 0.8519
Epoch 490/500
891/891 [==============================] - 0s 147us/step - loss: 0.3653 - acc: 0.8541
Epoch 491/500
891/891 [==============================] - 0s 148us/step - loss: 0.3634 - acc: 0.8552
Epoch 492/500
891/891 [==============================] - 0s 151us/step - loss: 0.3663 - acc: 0.8440
Epoch 493/500
891/891 [==============================] - 0s 119us/step - loss: 0.3627 - acc: 0.8519
Epoch 494/500
891/891 [==============================] - 0s 108us/step - loss: 0.3611 - acc: 0.8507
Epoch 495/500
891/891 [==============================] - 0s 102us/step - loss: 0.3652 - acc: 0.8507
Epoch 496/500
891/891 [==============================] - 0s 104us/step - loss: 0.3641 - acc: 0.8474
Epoch 497/500
891/891 [==============================] - 0s 101us/step - loss: 0.3954 - acc: 0.8182
Epoch 498/500
891/891 [==============================] - 0s 101us/step - loss: 0.3748 - acc: 0.8429
Epoch 499/500
891/891 [==============================] - 0s 108us/step - loss: 0.3640 - acc: 0.8507
Epoch 500/500
891/891 [==============================] - 0s 109us/step - loss: 0.3626 - acc: 0.8496
Out[348]:
<keras.callbacks.History at 0x1826db2a58>
In [349]:
test_X = process_dataset(test)
In [350]:
prediction = model.predict(test_X)
prediction_result = [0 if x[0] > x[1] else 1 for x in prediction]
result = { 'Survived': prediction_result }
solution = pd.DataFrame(result, index=test_X.index)
In [352]:
solution.to_csv('result.csv', index_label='PassengerId')