August 2018
Intermediate to advanced
378 pages
9h 9m
English
The previous code ran 48 traditional machine learning algorithms over the data across a number of different hyperparameters. Now, it is time to see if we can find a deep learning model that outperforms them. The first deep learning model is in Chapter7/classify_keras1.R. The first part of the code loads the data. The tokens in the reuters dataset are ranked by how often they occur (in the training set) and the max_features parameter controls how many distinct tokens will be used in the model. We will use all the tokens by setting this to the number of entries in the word index. The maxlen parameter controls the length of the input sequences to the model, they must all be the same length. If the sequences ...