## 5 Algorithm Application and Results
### Results and Discussion  
With all models' architecture and parameters chosen, the algorithms were trained for 400 epochs. As stated previously, this was performed to fully understand the behavior of each algorithm. As expected, after model optimization, the algorithms quickly converged and had the lowest loss values before 100 epochs, as seen in Figures 17-20. For the FNN, at about 250 epochs, the validation loss function started to grow, indicating that the algorithm was overfitting the data. While this showed that the FNN was more prone to overfitting compared to the other algorithms, the quick convergence mitigated the problem and allowed the algorithm to be suitable for the problem at hand. For the other algorithms, no overfitting occurred, even after 400 epochs, showing that they were more robust. Figure 16: Chosen architecture for the CNN, with two convolutional and two pooling layers with the total size of each layer represented under the graphical representation. Figure 15: Comparison between the total training time and the pool size for the CNN when fixing the filter size to 50 (blue) and 100 (orange). Relative to the FNN, the CNN presented little variation in the graphs, with a smooth decrease in loss and a steady increase in accuracy. Compared to the other algorithms, the GRU started with the highest value of the accuracy, around 0.60, while the others yielded about 30. Moreover, it had the lowest loss. This demonstrated the exceptional learning capacity of the algorithm for the type of problem presented. This was further confirmed by the aggressive overall growth until convergence, with around 35 epochs until the value stabilized. It is also important to point out that the maximum value was achieved in less than 20 epochs, but it took around 40 epochs until the values stabilized. Utilizing just the accuracy and loss criteria, the GRU emerged as the most-suitable algorithm of the ones studied in this work. The LSTM presented an initial and final accuracy similar to that of the CNN and FNN. The most-striking difference was the low learning rate that the algorithm showed, taking between 150 and 200 epochs to converge. This can be further seen with the erratic initial behavior of this algorithm, which implies that the weight values were being altered, which created an overshooting effect. When only analyzing Figure 20, it can be concluded that the LSTM algorithm was the least suitable for the problem at hand. Figure 19: Comparison between the loss and accuracy for the GRU algorithm in both training and validation cycles. Figure 17: Comparison between the loss and accuracy for the FNN algorithm in both training and validation cycles. Figure 18: Comparison between the loss and accuracy for the CNN algorithm in both training and validation cycles. As expected, due to the low layer count of all algorithms, there was no plateau followed by large decreases in the loss. With the plots broadly observed, it is still possible to dive deeper by using the variables listed in Table 2, where a condensed version of the information obtained from the graphs can be seen. These variables are commonly used to describe the performance and represent information that could be seen in a confusion matrix or error matrix:  
* The **accuracy score (acc)** is used to evaluate the ratio of correct predictions to the total number of instances. This can be calculated as \[acc=\frac{tp+tn}{tp+fp+tn+fn};\] (15) where \(tp\) denotes true positives, \(tn\) stands for true negatives, \(fp\) represents false positives, and finally, \(fn\) corresponds to false negatives. * The **precision score (p)*
* is the ratio of correctly predicted positive observations to the total number of positive ones. From a more intuitive perspective, it is the capacity of the algorithm to not label a positive sample as a negative one.