# Hierarchical Fusion of Machine Learning Algorithms in Indoor Positioning and Localization
## 2 Materials and Methods
### Machine Learning
The aim of this method is to create a stronger learning structure by using weak learners. AB can be used to improve the performance of any ML algorithm. However, it often uses a single-level decision tree algorithm as a weak learner algorithm since the processing load is much lower than other basic learning algorithms. The AB algorithm consists of four basic steps. In the first step, the N weak algorithms are run and the dataset is learned. Each of these N weak learning algorithms is assigned a weight value of 1/N. In the second step, error values are calculated in each of the learner algorithms. In the third step, the weight value of the learning algorithm with a high amount of error is increased. In the final step, the learning algorithms are summed with weight values and if the desired metric limit is reached, the total algorithm is output; otherwise, it returns to the second step [41; 42; 43]. As the number of learners in this algorithm increases, the processing load and the learning performance increases. First introduced by [PERSON], SVM is a supervised learning algorithm based on the statistical learning theory [44; 45]. SVM was originally developed for binary classification problems. While SVM was only used for classification at first, it eventually began to be used in linear and non-linear regression procedures as well [46]. SVM aims to find the hyper-plane, which separates classes from each other, and which is the most distant from both classes. In cases where a linear separation cannot occur, the data are moved to another space of a higher dimension, and the classification is performed in that space. While the classification processes aim to separate data from each other by means of the generated vectors; the regression, in a sense, performs the opposite of this process and aims to create a hyper-plane by identifying support vectors in a way that they will include as many data as possible [47]. The SVM is mainly divided into two categories according to the linear separability of the dataset. Non-linear SVM decision function is given in Equation (2). In cases where the data cannot be separated linearly, the data are moved to a space of higher dimension, and kernel functions are used to resolve them. The transformations can be made by using Kernel functions expressed as K(x\({}_{i}\),x\({}_{j}\)) = \(\Phi\)(x) \(\Phi\)(x\({}_{i}\)) instead of \(\Phi\)(x) \(\Phi\)(x\({}_{i}\)) scalar product given in Equation (2). Also, non-linear transformations can be made, and the data can be separated in the high dimension thanks to the Kernel functions. Therefore, Kernel functions have a critical role in the performance of SVM. The most widely used of these Kernel functions are linear, polynomial, Radial Basis Function (RBF), and Sigmoid, all of which are given in Table 3[47; 48; 49]. In this table, x\({}_{i}\) and x\({}_{i}\) corresponds to window coefficients. x\({}_{i}\) is the width parameter and the x\({}_{i}\) represents the place of the window. In the polynomial function, the parameter d corresponds to the degree of the polynomial. In radial basis function, on the other hand, \(\gamma\) is equal to Gaussian function. In this study, only RBF was used as the SVM Kernel function. \[f(x)=\text{sign}(\sum_{i=1}^{N}a_{i}y_{i}\Phi(x)\Phi(x_{i})+\text{b}) \tag{2}\]  
K-fold cross validation is a method used in the performance evaluation of learning algorithms [50; 51]. In the evaluation processes, it is essential to create a dataset for training and testing and to test the performance of the model that actualizes the learning with training data on the test dataset. However, performance evaluation may not be reliable because of not having the same distribution when selecting the training and test data in the dataset, uneven distribution of outliers, and so on. Therefore, K-fold cross validation method was developed. In this method, training and test data are integrated and turned into a single dataset. All data are divided into K equal parts. The K value here is determined by the user.