# Regressive Machine Learning for Real-Time Monitoring of Bed-Based Patients
## 3 Results
### Learning Curves  
Learning curves are a diagnostic tool in ML that provides insights into how well a model is learning from the training data and generalizing to unseen data. They plot the model's performance on both the training and cross-validation datasets over a series of training iterations. The training score reflects how well the model fits the training data. The cross-validation score, on the other hand, indicates how well the model generalizes to unseen data. If the training score is significantly higher than the validation score, it suggests that the model might be overfitting, meaning it is too complex and is fitting the noise in the training data rather than the underlying pattern (as seen in Figure 2a). The point where the training score and cross-validation score converge is considered a good indication of the optimal model complexity (as seen in Figure 2b).  
Note, that the maximum training sizes (in Figure 2) are different with and without SMOT because SMOT creates synthetic examples of the minority class, effectively increasing the size of the training data. This allows the model to be trained with more data when SMOT is used.  
\begin{table}
\begin{tabular}{c c c} \hline
**BR** & **Mean** & **Standard Deviation** \\ \hline Without SMOT & 0.9374 & 0.0258 \\ With SMOT & 0.9705 & 0.0146 \\ \hline \end{tabular}
\end{table}
Table 4: Performance comparison of ensemble model with and without SMOT.  
Figure 2: The performance of the ensemble model on the training and validation sets over a series of training iterations. Part (**a**) shows the learning curve without the application of SMOT, while part (**b**) demonstrates the learning curve with SMOT. The use of SMOT appears to enhance the model’s ability to handle imbalanced datasets, as evidenced by the improved performance in part (**b**).  
The learning curves in Figure 2a start with a significant gap of 60 score points between the training and cross-validation scores. This large gap indicates that the model is initially overfitting the training data, meaning it performs well on the training data but poorly on the unseen cross-validation data. As the model is trained with more data, the cross-validation score rises, suggesting that the model is learning and generalizing better. However, by the maximum training size, the curves are still far apart, indicating that the model is still overfitting. This suggests that the model has learned the training data too well and is not generalizing well to unseen data.  
The learning curves in Figure 2b start with a smaller gap of 15 score points between the training and cross-validation scores. This smaller gap suggests that the model is not overfitting as much as in the case without SMOT. As the model is trained with more data, the cross-validation score rises and converges with the training score by approximately halfway between the smallest and largest training size. Once converged, the two scores remain close for the rest of the training size, from the middle to the maximum. This sustained convergence indicates that the model is generalizing well to unseen data and is not overfitting or underfitting. The use of SMOT, which creates synthetic examples of the minority class, seems to help the model learn better and generalize better to unseen data.  
SMOT was employed to mitigate the issue of overfitting, as evidenced by the non-convergence of the training and validation curves in the initial model (Figure 2a). The application of SMOT led to the convergence of these curves (Figure 2b), indicating an improvement in the model's performance. Although the specific changes in the distribution of movement classes after applying SMOT were not directly evaluated, the overall enhancement in the model's performance suggests that SMOT effectively bolstered the predictive power for minority classes.