## 4 Case Study and Applications
### Assessment of Implementation Performance  
The recall figures obtained in Table 9 demonstrate that the model correctly identifies 74% and 77% of all positive cases, respectively, for an equal number of 100 iterations and 100 particles in the ground truth, utilising the DSPSO and PSO algorithms. The F1-score calculated for 100 particles and 100 iterations corroborates that both measures of precision and recall are consistent with the results obtained through the application of either of the two implemented variants of PSO. This demonstrates a balance between the two measures and that the results have also been obtained with performance.  
Consequently, the model appears to be robust and thus quite acceptable, as evidenced by the summary of one selected run in Table 10. Similar performance was observed for the DSPSO and DAPSO variants, along with the near 0.77 accuracy discussed above, indicating that both algorithms demonstrate good predictive performance.  
Table 10 contains information extracted from the Apache Spark Web UI (Web UI), which is a web-based graphical interface that provides detailed information about the status and performance of running Spark applications. In particular, it shows information about the executors within the cluster, including resource utilisation, particularly the memory blocks used by the entire computation, and the activity of Spark jobs or tasks. In the context of the distributed PSO algorithms implemented in this study, each job comprises a set of particles whose fitness function is evaluated by the executor nodes. Thus,  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & **DSPSO** & **DAPSO** \\ \hline \# cores & 16 & 16 \\ Storage memory & 25 MiB & 135 KiB \\ Max. active tasks & 15 & 5 \\ Total number of created tasks & 2960 & 992 \\ Task execution (CPU) accumul. time & 28,800 s. & 660 s. \\ Task execution (GPU) accumul. time & 384 s. & 7 s. \\ Average time of 1 parallel run & 1554 s. & 1060 s. \\ \hline \hline \end{tabular}
\end{table}
Table 10: Performance of DSPSO and DAPSO on a Spark cluster with information on the number of executors and the number of blocks.  
Figure 10: Classification performance using the DAPSOshown by (**a**) ROC curve and (**b**) PR curve.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Classifier**} & \multicolumn{2}{c}{**Precision**} & \multicolumn{2}{c}{**Recall**} & \multicolumn{2}{c}{**F1-Score**} \\  & **10** & **100** & **10** & **100** & **10** & **100** \\ \hline PSO & 0.558 & 0.666 & 0.584 & 0.592 & 0.335 & 0.555 \\ DSPSO & 0.62 & 0.74 & 0.73 & 0.74 & 0.67 & 0.74 \\ DAPSO & 0.68 & 0.77 & 0.74 & 0.77 & 0.71 & 0.77 \\ \hline \hline \end{tabular}
\end{table}
Table 9: Accuracy assessment of smoking status using bio-signals with 10 and 100 particles.  
the concurrent execution of multiple jobs on the Spark cluster has been achieved, with each job representing the parallel execution of multiple tasks. In the case of the DAPSO implementation, the master node collects the results of the execution of each task from the cluster in an asynchronous manner, updates the global variables, and returns the particle to the task. This process allows for the reuse of tasks and the pursuit of improved load balancing between them. Consequently, the DAPSO approach results in a notable reduction in the number of tasks required to evaluate the fitness of each particle in the cluster. As can be observed in Table 10, a maximum of five simultaneously active tasks are required. It can be stated that DAPSO is a Spark-jobs \"recycler\" to a greater extent than DSPSO. Consequently, the memory usage is only 135 KiB, in comparison to the 25 MiB required by DSPSO to perform the same task. It can therefore be concluded that the DAPSO variant is more suitable for execution on resource-constrained nodes in an edge architecture.  
The hardware and software platforms used for the experiments are listed in Table 11.