# A New SDN-Based Routing Protocol for Improving Delay in Smart City Environments
## 3 Machine Learning Algorithms  
The scalability of the network and the heterogeneity of equipment and the full range applications deployed in smart cities make the SDN controller tasks complicated and tedious. Therefore, network management and data routing mechanisms produce a large number of overhead packets and long transmission delays, thus disrupting the systems' functionalities based on real-time applications.  
ML algorithms are introduced in SDN to overcome these challenges [35]. This provides robust computation and optimized processing to predict essential information in the routing paths construction or the network topology discovery either in the allocation resources. Mainly, the advantage of using Machine Learning techniques consists of reducing transmission delay and control packets significantly in routing applications. ML algorithms rely on real-time and historical network data to operate. They analyze them and then estimate and predict a future situation or outcome that can bring intelligence to the SDN controller. The controller will be able to optimize network configuration and automatically deliver new network services in real-time.  
ML techniques are divided into four approaches: supervised, unsupervised, semi-supervised, and reinforcement learning. Supervised learning is based on pairs of input-output observations to learn a function explaining the relationship between them by looking for patterns in the value labels assigned to the data points [36]. This algorithm predicts an outcome variable given a set of input variables, and it creates a system model that matches inputs to target outputs. Once the training process has reached the level of precision, the model can be used to achieve the desired result. There are various models of supervised learning, such as neural networks, regression, decision tree, nearest k-neighbor, logistic regression, support vector machine, and Naive Bayes, etc. However, our work focuses on the Naive Bayes supervised learning approach that we investigate in this section.  
The concept of Bayesian machine learning depends on the conditional probability of calculating the probability that an instance will occur given a particular set of attributes corresponding to previous knowledge, which might be related to it. This learning method classifies a new event or incident into a set of possible outcomes provided by previous training data. The classifier Naive Bayes tries to find the most likely value for a current instance given its known attributes. Bayesian learning uses the most probable result, often called the maximum a posteriori to classify the hypothesis. It is based on the Bayesian theorem defined in Equation (1) as follows [37]:  
\[P(C|X)=\frac{P(X|C)P(C)}{P(X)} \tag{1}\]  
where \(P(C)\) is the prior probability of hypothesis \(C\), \(P(X)\) is the prior probability of training data \(X\), \(P(X|C)\) probability of \(X\) given \(C\), and \(P(C|X)\) probability of \(C\) given \(X\).  
In the next section, we explain the creation and transformation of the dataset used in our ML framework, and we introduce the proposed model and formulation problem.