# Machine Learning Prediction Approach to Enhance Congestion Control in 5G IoT Environment
## 3 Proposed Congestion Control Prediction Approach
### Preparing the Training Dataset
#### 3.3.1 Applying the Machine Learning Approach  
This phase of model implementation generates J48. Different machine learning approaches (e.g., clustering) are used in many fields for applications such as enhancing the performance of network nodes using clustering [19] and classifying the academic performance of students [62]. Compared with other data mining approaches, the DT approach plays numerous roles. The DT approach, as a part of machine learning [63], shows promising performance according to previous studies [64; 65; 66] that applied the approach in numerous fields, including medicine [67; 68; 69], e-government [70], wireless sensor networking [71], mobile authentication systems [72; 73], and intrusion detection [57; 74]. The DT algorithm builds an oriented tree graph based on training data for classification and regression. The tree graph comprises the root node, which branches to a subtree and ends with a leaf node. The path from the root to the leaf node passes through nodes that represent the attributes of the dataset. This path can be considered for the prediction of future cases. IF condition statements are used to build and translate the resulting tree [75]. DT is a robust and convenient machine learning approach that can be utilized in knowledge discovery to find hidden patterns in small and large datasets. Creating a tree  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**N** & **CWND** & **Throughput** & **Queue Size** & **Packet Loss** & **Optimal** \\ \hline
1 & 120 & 9,881,687 & 48424 & 209 & N \\ \hline. &. &. &. &. &. \. &. &. &. &. & O \. &. &. &. &. &. \\ \hline
100 & _cwnd_ & _throu_ & _que_ & _pkt loss_ & \(N\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Classified optimal alternatives. CWND: congestion window size; O: optimal; N: non-optimal.  
involves three stages: construction, computation of information gain, and pruning. The construction stage includes the following basic steps [76; 77]:  
* Verify if all issues belong to the same class. Thus, a tree is a leaf that is labeled according to class.
* Compute the information gain and the information for a piece of the attribute.
* On the basis of the present selection criterion, locate the optimal splitting attribute.  
The calculated information gain of entropy is used. Entropy is the measure of the uncertainty of a random variable. The entropy of Q is measured as follows:  
\[Entropy(q)=-\sum_{i=1}^{n}\frac{\left|qi\right|}{\left|q\right|}log\left( \frac{\left|qi\right|}{\left|q\right|}\right), \tag{6}\]  
where the conditional entropy is  
\[Entropy(i|q)=-\sum_{i=1}^{n}\frac{\left|qi\right|}{\left|q\right|}log\left( \frac{\left|qi\right|}{\left|q\right|}\right), \tag{7}\]  
where information gain is calculated as  
\[Gain(q,i)=Entropy\left(p-Entropy(i|q)\right). \tag{8}\]  
If the split is based on high gain, then the resulting tree will be small and efficient. In the final stage, a pruning technique is implemented to address overfitting and outliers. Pruning is used to classify datasets with poorly defined instances. Pruning is made up of two types. Online pruning is performed during tree creation, and post-pruning is performed after tree creation. Pruning implementation is based on separate-and-conquer rule schema. For the separate and conquer technique for P instances, the pruning steps are presented in Table 2.