We need to use the following code to compile the model:
model %>% compile(optimizer = "rmsprop",
loss = "binary_crossentropy",
metrics = c("acc"))
From the preceding code, we can observe the following:
- We have used the rmsprop optimizer to compile the model.
- For loss, we have used binary_crossentropy since the response has two values, that is, positive or negative. Metrics will make use of accuracy.
Now, let's start fitting the model.