Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. model = Sequential()
  2.  
  3. #get number of columns in training data
  4. n_cols = X_train.shape[1]
  5.  
  6. #add model layers
  7. model.add(Dense(8, activation='relu', input_shape=(n_cols,)))
  8. model.add(Dense(8, activation='relu'))
  9. model.add(Dropout(rate = 0.05))
  10. model.add(Dense(8, activation='relu'))
  11.  
  12. model.add(Dense(1))
  13. #adam = optimizers.Adam(lr=0.0001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.0, amsgrad=False)
  14. model.compile(optimizer='adam', loss='mae')
  15. history = model.fit(X_train, y_train, epochs= 200, validation_split=0.2, batch_size=128)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement