# Hierarchical Fusion of Machine Learning Algorithms in Indoor Positioning and Localization
## 2 Materials and Methods
### Machine Learning  
Gaussian naive Bayes (GNB) classifier is a probabilistic classifier algorithm based on [PERSON] theorem [31]. Due to its low computational load and high correct classification performance, it has been widely chosen in the studies aimed for classification. The aim of the naive Bayes classifier is to compute the \(i\)-th observation that is obtained by computing the posterior probability of class \(c\) for a given feature \(x_{i}\). Calculation of the posterior probability is given in Equation (1). In this equation P(\(c|x_{i}\)), is the posterior probability while P(\(c\)) is class prior probability and P(\(x_{i}|c\)) is the likelihood, which means probability of \(i\)-th feature, and finally, P(\(x_{i}\)) is the prior probability of feature \(i\). There are three main steps in the naive Bayes algorithm. In the first step, the algorithm calculates the frequency values of each output category according to the dataset. In the second step, the likelihood table is calculated. In the last step, probability of output class according to Gaussian Distribution is calculated [31; 32]. \[\mathrm{P}(c|x_{i})=\frac{\mathrm{P}(c)\mathrm{P}(x_{i}|c)}{\mathrm{P}(x_{i})} \tag{1}\]  
The K nearest neighbors (KNN) algorithm is a learning algorithm that operates according to the values of the nearest k-neighbor. The KNN algorithm is a non-parametric method for classification and regression [33]. It was first applied to the classification of news articles [34]. When performing learning with the KNN algorithm, firstly, the distance of the data to others is calculated in the dataset examined. This length calculation is done with Euclidian, Manhattan, or Hamming distance function. Then, the mean value of the nearest K neighbors is calculated for the data. The K value is the only hyper-parameter of the KNN algorithm. If the K value is too low, then the borders are going to be flickering and overfitting will occur, whereas if the K value is too high, the separation borders are going to be smoother and underfitting will occur. The disadvantage of the KNN algorithm is that in the distance calculation process, it increases the processing load as the number of data increases. Decision tree (DT) algorithm is an algorithm that is frequently used in statistical learning and data mining. It works with simple if-then-else decision rules and is used for both classification and regression in supervised learning [35]. It has three basic steps. In the first step, the most meaningful feature is placed as the first (root) node. In the second step, datasets are divided into subsets according to this node. Subsets should be created in such a way that each subset contains data with the same value of a feature. In the third step, step one and two are repeated until the last (leaf) nodes in all of the branches are created. The decision tree algorithm builds classification or regression models in the form of a tree structure. It splits a dataset into smaller subsets while at the same time an associated decision tree is incrementally developed. The result of this algorithm is a tree with decision nodes. Decision trees can handle both categorical and numerical data [36; 37]. The RF method is designed in the form of a forest consisting of many DT's [38]. Each decision tree in the forest is formed by selecting the sample from the original dataset with the bootstrap technique and selecting the random number of all variables in each decision node. The RF algorithm consists of four fundamental steps. First, n features are randomly selected from a total of m features. Second, the node d using the best split point is calculated among the n features. Third, it checks whether the number of final (leaf) nodes reaches the target number. If it does, it moves on with the next step; if not, the algorithm goes back to step one. Finally, by repeating steps one to three for n (number of trees in the forest) times, a forest is built [38; 39; 40]. The adaptive boosting (AB) algorithm is a ML method, which is also known as an ensemble method.