## 4 Results and Discussion
### Four-Sensor Configurations
#### 4.4.4 Confusion Matrix Analysis for Four-Sensor 50%-Overlapping Configuration  
In this configuration, four sensors--accelerometer, gyroscope, linear accelerometer, and gravity--are used with a 50% overlapping strategy applied to the data segments. This method enhances the models' ability to capture contextual transitions between activities, improving overall performance and classification accuracy. The confusion matrices reveal the following patterns:  
DT: The DT confusion matrix in Figure 13a shows accurate classification of 441 instances of _run_rows_ and 960 instances of _stn_ws_. However, it struggles with 15 misclassifications for the _run_rows_ class and 1 for the _walk_rows_. These misclassifications suggest that despite the additional overlapping data, DT still faces challenges in accurately distinguishing activities with similar sensor signals [26]. Figure 13: _Cont._KNN: The KNN confusion matrix in Figure 13b indicates improved performance, particularly for the 456 correct classifications of _run_wos_ and 442 correct classifications of _wlk_wos_. However, it misclassified 59 instances for _stn_ws_, reflecting KNN's sensitivity to overlapping data and potential difficulty in distinguishing between stationary activities [35]. RF: The RF confusion matrix in Figure 13c shows strong results, with 960 correct classifications for the _stn_ws_ class and only seven misclassifications for the _run_wos_. RF's ensemble learning approach enhances its ability to generalize well across various sensor features, making it effective in this configuration, despite its occasional challenges in capturing complex dependencies among sensor inputs [26]. SVC: The SVC confusion matrix in Figure 13d demonstrates strong performance, correctly classifying 455 instances of _run_wos_ and 952 instances of _stn_wos_. While generally robust, SVC faces some challenges with stationary classes, misclassifying 73 instances of _stn_ws_ as _stn_wos_. This suggests that although SVC effectively handles overlapping sensor data, further refinement could enhance accuracy in distinguishing stationary states [39]. XGBoost: The XGBoost confusion matrix in Figure 13e demonstrates strong performance, with 958 correct classifications for _stn_wos_ and 452 for _run_wos_, with only four misclassifications in the latter. However, it misclassifies 73 instances of _stn_ws_ as _stn_wos_, highlighting a challenge in distinguishing closely related stationary classes. This indicates XGBoost's effectiveness with complex data interactions, albeit with slight limitations in handling subtle distinctions in stationary activities. GRU: As shown in Figure 13f, the GRU model performs well, with 923 correct classifications for _stn_wos_ and 461 for _stn_ws_. However, it misclassifies 69 instances of _stn_ws_ as _stn_wos_, highlighting some difficulty in distinguishing similar stationary activities. Overall,  
Figure 13: Confusion Matrices for models using a four-sensor configuration with 50% overlapping data segments: (**a**) DT, (**b**) KNN, (**c**) RF, (**d**) SVC, (**e**) XGBoost, (**f**) GRU, (**g**) LSTM, (**h**) TCN, (**i**) Transformer. GRU's ability to capture temporal dependencies makes it effective for most classes, though additional tuning could improve its handling of overlapping sensor data [37]. LSTM: The LSTM confusion matrix in Figure 13g indicates strong performance, particularly with 972 correct classifications for the _stm_wos_ class. However, there are some minor misclassifications, including 64 instances of _stm_ws_ incorrectly classified as _stm_wos_. Despite these few errors, the LSTM model generally shows robustness across most activity categories, leveraging its ability to capture sequential dependencies effectively [38]. TCN: The TCN confusion matrix in Figure 13h demonstrates high classification accuracy across activities, with 984 correct classifications for the _stm_wos_ class. However, there are 60 misclassifications for the _stm_ws_ class, indicating a slight limitation in distinguishing between stationary activities.