In this section, we will develop the model architecture, compile the model, and then fit the model.
Creating and fitting a deep neural network model
Developing model architecture
The code used for developing the model is as follows:
# Initializing the model
model <- keras_model_sequential()
# Model architecture
model %>%
layer_dense(units = 8, activation = 'relu', input_shape = c(21)) %>%
layer_dense(units = 3, activation = 'softmax')
As shown in the preceding code, we start by creating a sequential model using the keras_model_sequential() function, which allows a linear stack of layers to be added. Next, we add layers to the model using the pipe operator, %>%. This pipe operator takes information...