## 6 Applying Machine Learning Based on Cloud Services
In particular, three supervised multiple classification algorithms have been evaluated to select the most appropriate: Multiclass Logistic Regression, Multiclass Decision Forest and Multiclass Neural Network. Multiclass Logistic Regression classifier is based on the logistic regression method that predicts the probability of an outcome by fitting the data to a logistic function. A simple logistic regression model calculates the probability that an instance does or does not belong to a class using a sigmoid function applied to the linear combination of the input characteristics, resulting in linear decision boundaries. The training process is fast, as it only attempts to minimize a cost function based on the logarithmic of that probability. Multiclass Logistic Regression, also called Multinomial Logistic Regression or Softmax Regression, generalizes logistic regression for several classes. However, as the original binary classification method does, it defines linear decision limits, so despite its fast training, it is not very suitable for the problem under consideration, as can be seen from the resulting confusion matrix that is shown in Figure 17. The training time was 17 s. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Access Point (BSSID)** & **Power Received (dBm)** & **Room** \\ \hline
70:03:7e:9a:e3:64 & \(-\)23 & 1 \\
72:03:7e:9a:e4:65 & \(-\)31 & 1 \\
96:6a:77:27:01:3c & \(-\)61 & 1 \\... &... &... \\
72:03:7e:9a:e4:65 & \(-\)42 & 2 \\ cc:32:e5:62:e1:d6 & \(-\)81 & 2 \\ e8:20:e2:3d:48:c7 & \(-\)54 & 2 \\... &... &... \\
70:03:7e:9a:e3:64 & \(-\)57 & 3 \\ e8:20:e2:3d:48:c7 & \(-\)54 & 3 \\
94:2:cb3:56:09:5d & \(-\)59 & 3 \\... &... &... \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Samples of data collected by Andruino-R2 moving in a three-room layout. determines the capacity and complexity of the neural network. For example, deep neural networks [43] present a high number of hidden layers for visual recognition, which is a complex task, although for tasks similar to those considered in this example, just one, or a small number, of hidden layers is generally sufficient. The learning is given by adjusting the weights that weight the inputs in the connections between each node in each layer, and this is done using a backpropagation algorithm. Therefore, the training time is usually high. Once the weights are set in the training, the output is predicted by propagating the values of the inputs through the layers. Figure 18 shows the confusion matrix obtained with a Multiclass Neural Network classification algorithm on the dataset. The training time was 48 seconds using a Neural Network with a hidden layer, 500 nodes, 0.1 learning rate, and 1000 learning iterations. The results obtained show that do not allow an adequate generalization of the samples available. Thus, students can observe that using Neural Networks is not the solution in all cases, along with the black box perspective inherent in Neural Networks. The last classification algorithm used is **Multiclass Decision Forest**, which is based on the use of multiple decision trees. A decision tree learning algorithm creates a tree that goes from the observations on the features (represented in the branches) to a final classification (represented in the leaves). This tree is formed during the training process by recursively splitting the training set into two, trying to minimize impurity. The Multiclass Decision Forest is a generalized decision tree for several classes, but like the original, it defines non-linear decision limits, and it is resilient in the presence of noisy features. The algorithm builds multiple decision trees and then the probabilities of each output class are determined, weighting the output of each tree based on the calculation of label histograms and a normalization process. In this way, trees with high confidence in the prediction have greater weight in the decision. It is computationally fast, and allows to obtain good results with a little large quantity of data.