## 3 Materials and Methods
### The Context-Aware Prefetch Scheme
#### 3.1.1 The Offline Phase
For instance, in the current scenario, the LSTM model needs to be trained with and without an instance in order to examine whether this instance can be considered influential or not. As mentioned above, the influential instances are usually used in order to explain the outcomes of machine learning or deep learning models, which are difficult to interpret. The current solution, though, differentiates from the current way the influential instances are used, since it utilizes the influential instances in a way that will empower the LSTM model through the provision of additional information with respect to the data. In more detail, it will provide the model a list of instances that may be more significant than others, which the model may use in order to improve itself. The way these influential instances are identified is shown below. The effectiveness of an instance \(i\) on the model's parameters can be measured using \(DFBETA\), which is defined as follows [36]:  
\[DFBETA_{i}=\beta-\beta^{(-i)} \tag{1}\]  
where \(\beta\) is the weight vector of the initial model that is trained with all instances and \(\beta^{(-i)}\) is the weight vector when the model is trained without the \(i\)th instance. However, the calculation of \(DFBETA\) alone cannot provide contextual information regarding the influence of a specific instance on the model and its predictions. Additional metrics need to be used. For this reason, the root mean square error (RMSE) is also calculated as shown below:  
\[RMSE_{i}=\sqrt{\frac{1}{n}\sum_{j=1}^{n}{(y_{j}-\hat{y}_{j})}^{2}} \tag{2}\]  
where \(i\) is the instance that is removed in order to calculate its influence, \(n\) is the number of instances, \(y_{j}\) is the correct target value, and \(\hat{y}_{j}\) is the prediction of the model. Figure 3: LSTM for time series classification model architecture. With the use of \(DFBETA\) and the calculation of the \(RMSE\) for each instance, the influence of the instance on the model can be evaluated. With this information, the instances are sorted based on significance, and the most influential ones are then kept for the next step. As depicted in Figure 4, once \(DFBETA\) and the \(RMSE\) are calculated, they are then provided as input to the next step, which regards the creation of clusters of important instances with respect to the ones that were previously identified. This is performed with the use of the k-means [37] algorithm. In more detail, these instances are provided to the k-means algorithm as initialization points for the centroids, and based on them, the training of the algorithm is instantiated. One important note is that by default, the k-means algorithm utilizes the Euclidean distance for cluster creation, but since the current problem relates to time series data, the Euclidean distance is not useful. For this reason, the dynamic time warping matching [38] distance metric is utilized. This metric measures the similarity between sequences that may vary in steps and, in essence, can calculate an optimal match between them. Consequently, the remaining instances that were not initially categorized as influential are forwarded to the k-means algorithm, and if the distance from one of the centroids is smaller than a given number, it is considered part of this; otherwise, it is considered an outlier, as also depicted in Algorithm 1. The above step is repeated for all remaining instances in the initial data set of sequences. Once this is over, the instances that belong to either of the clusters are used as input for the LSTM model for re-training. The offline phase is repeated daily, while all incoming requests are stored in a dedicated database in order to re-apply the above shown scheme with the new data. This database includes historical data of the requests that are made by dedicated healthcare professionals to the cloud. In detail, what is stored is a timestamp of the request, the requested file, and the session in order to group all requests made during the same emergency.