## 3 Materials and Methods
### Discrete Blood Pressure Prediction
#### 3.4.2 Models  
A number of machine learning models have been considered. The models considered include artificial neural networks (ANNs) with a regression output, recursive neural networks (RNNs), specifically long short term memory (LSTM) networks, regression support vector machines (SVMs), and convolutional neural networks (CNNs).  
There is a difference between the models applied in the deep and classical machine learning approaches. The LSTMs and CNNs are considered for the deep learning approaches only. LSTMs (and RNNs, in general) contain feedback loops within each activation unit, in turn providing the model with memory [11]. This makes them good for sequential data [11]. LSTMs struggle to manage long sequences and, so for, this network only 2 s of PPG data was used for the last 1s of ABP values [11]. CNNs are adept at finding patterns and features within data, and so these were also applied to the sequential waveform data. Regression SVMs, on the other hand, are only applied to the feature dataset since SVMs are generally computationally intensive, and the waveform data is much larger than the feature dataset.  
For the ANNs, RNNs, and CNNs, the Adam optimiser was used with a batch size of 128. A mean squared error cost function was used. Datasets were shuffled and split into training, validation, and test sets in a 70-15-15 ratio, respectively. All features and waveforms in each dataset were shifted and scaled to range from \(-1\) to \(1\). The approach adopted to train the models was to train for 10 epochs, starting with a learning rate of \(10^{-4}\). From this, the hyperparameters were tuned. If the training loss was decreasing particularly slowly, the learning rate was increased, and if the training loss was fluctuating, then the learning rate was decreased. If the model was underfitting the data (consistently high training and validation losses), then the regularisation parameter was decreased or the model complexity increased. The opposite was performed for an overfit, where there is low training loss and high validation loss. Models were trained until the validation loss did not improve for at least 20 consecutive epochs, with a learning rate of \(10^{-6}\).  
All-in-all, nine machine learning models have been considered, four for the deep learning models and five for the classical learning models. The ANNs considered for both approaches are two layers of 512 activation units and three layers of 512. For the classical approach, an additional four layers of 512 was also implemented. The 1D CNN applied to the full waveform has three convolutional layers. Between each of these are a batch normalisation and rectified linear unit (ReLU) layer. At the output is a global average pooling layer and a regression output [25]. The LSTM follows [PERSON] et al.'s architecture [11], consisting of three LSTM layers of size 128, separated by a batch normalisation layer. The first LSTM layer in this architecture is bilinear [11]. A regression SVM and a binary decision tree for regression were also applied to the feature dataset.  
Results for the discrete blood pressure prediction can be found in Section 4. The machine learning models to predict the waveform shape are discussed in the following section.