May 2019
Intermediate to advanced
664 pages
15h 41m
English
Training the model is quite interesting, I believe. We will pass the model to the fit() function, having specified the features, response, number of epochs, and validation percentage at each epoch. Here, I have gone with 100 epochs, and 20% of the training data for validation:
> epochs <- 100> # Fit the model and store training stats> history <- model %>% fit( trainT, train_logy, epochs = epochs, validation_split = 0.2, verbose = 0)
You can examine the history object on your own, but what is very powerful is to plot the training and validation error for each epoch:
> plot(history, metrics = "mean_absolute_error", smooth = FALSE)
The output of the preceding code is as follows:
Notice how much the error differs between training ...