## 3 Materials and Methods
### Machine Learning Algorithms for Fall Detection
#### 3.4.1 Selected Machine Learning Models  
In this study, four machine learning algorithms were implemented for fall detection: DT, RF, SVM, and XGBoost. These algorithms were selected based on their proven effectiveness in classification tasks involving structured data and their widespread application in activity recognition and health monitoring domains [16]. Multiple algorithms were implemented to conduct a comparative study, allowing for a more comprehensive evaluation of different modeling strategies and helping identify which algorithm performs best in the specific context of fall detection using the available data. A **DT** algorithm [62] is both a nonparametric and supervised learning method for classification and regression. It continuously divides the data based on feature value selection with the intention of forming subsets that are as homogenous as possible at all nodes. DTs are highly preferred due to their simplicity and interpretability, as well as being capable of working with numerical and categorical data. However, DT models are highly susceptible to overfitting, particularly when they are not restricted in depth. **RF**[63] is an ensemble learning method that builds multiple Decision Trees and aggregates their predictions to improve accuracy and robustness. Each tree in the forest is trained on a bootstrapped sample of the dataset, and at each node, a random subset of features is considered for splitting. The final prediction is determined by majority voting in classification tasks. RF reduces the risk of overfitting by leveraging multiple trees, making it highly effective for complex classification problems. **SVM**[64] is a widely used supervised learning algorithm designed for both classification and regression tasks. The primary goal of SVM is to find an optimal decision boundary, known as a hyperplane, that best separates different classes in a dataset. This boundary is chosen to maximize the margin, which is the distance between the hyperplane and the nearest data points from each class, known as support vectors. A larger margin generally leads to better generalization and improved classification performance on unseen data. When data is linearly separable, SVM constructs a straight hyperplane that effectively divides the feature space into distinct regions. However, in cases where the data is not separable in its original space, SVM employs kernel functions to transform the data into a higher-dimensional space where a linear separation becomes possible. Commonly used kernels include:  
* Linear Kernel: Applied when the data is linearly separable, as it maintains the original feature space without transformation;
* Polynomial Kernel: Projects input features into a higher-degree polynomial space, enabling the model to capture complex, nonlinear relationships;
* Radial Basis Function (RBF) Kernel: Commonly employed for its ability to map data into an infinite-dimensional space, making it highly effective for modeling intricate and nonlinear patterns;
* Sigmoid Kernel: Derived from neural network activation functions, it is used in scenarios where data exhibits specific probabilistic distributions. To enhance flexibility, SVM also incorporates a regularization parameter that controls the trade-off between achieving a perfect separation of training data and maintaining generalization to unseen examples. If the parameter is too high, the model may overfit; if too low, it may underfit. SVM is particularly effective in high-dimensional spaces and is known for its robustness against outliers and noise. However, it can be computationally expensive, especially when applied to large datasets. **XGBoost**[65] is an advanced gradient boosting algorithm designed for speed and efficiency. It builds an ensemble of weak decision trees sequentially, where each new tree corrects the errors of the previous ones by minimizing a regularized objective function.