4d5e36148001b363c9871220e4f6cc26f00a757a
2 from keras
.models
import Sequential
3 from keras
.layers
import Dense
, Dropout
# , Activation
7 model
.add(Dense(50, input_shape
=(13,), activation
='relu'))
8 model
.add(Dense(50, activation
='relu'))
9 model
.add(Dense(50, activation
='relu'))
10 model
.add(Dense(1, activation
='sigmoid'))
13 loss
='binary_crossentropy',
19 dat
= np
.genfromtxt('train.txt', dtype
=float, delimiter
='\t', usecols
=range(1, 14))
20 lab
= np
.genfromtxt('train.txt', dtype
=int, delimiter
='\t', usecols
=[0])
22 model
.fit(dat
, lab
, epochs
=10, batch_size
=32)
24 with
open('model.json', 'w') as f
:
25 f
.write(model
.to_json())
26 model
.save_weights('model.hdf5')