# Dynamic Packet Duplication for Industrial URLLC
## 3 Proposal
### Random Forests  
In this paper, random forests [34] were selected for the implementation of the ML part of the system. The choice of this method is based on the computation simplicity once the model has been trained, since fast prediction for URLLC services must be performed.  
Random forests are an ensemble method commonly used to resolve several types of ML learning problems, such as classification and regression. A random forest consists of a set of decision trees. Each decision tree takes the input to the forest and returns an estimated value. The structure of the tree is created in the training process. On each tree, a decision is performed by comparing the input with a threshold. Based on the output of the comparison, a new comparison is performed with a different input and threshold, which determines the prediction of the tree.  
To improve the accuracy, each decision tree output is aggregated. For regression, the aggregation method is typically the average of the output of all the trees. A summarized scheme of the random forests prediction is shown in Figure 3.  
Moreover, several parameters must be adjusted before starting the execution, related to the performance of both the decision trees and the complete set that builds the forest. Some of the most important configuration parameters are the following:  
* Number of decision trees: this establishes the number of trees that constitutes the forest. This must be chosen in relation to the input dataset to avoid overhead.
* Bootstrap: this parameter decides how each tree is built independently. If it is not activated, the complete dataset is used for each tree. Otherwise, the initial dataset is divided into subsets of dataset for each tree.  
Figure 3: Random forest prediction scheme.  
* Division criterion: this defines the quality of a split according to the condition set in the node. The most used criteria for regression are the squared error and absolute error.
* Maximum leaves per tree: this sets the maximum depth of the tree in the forest.
* Maximum samples to split: this determines the maximum number of samples to consider in order to choose the condition that determines the split.
* Minimum samples to split: this determines the minimum samples needed to consider a new split.  
A training method is applied over a set of labeled samples, (vectors with inputs to the system and the expected output) to obtain the trees. The training process [34] consists of randomly selecting a subset of features and a subset of training samples for each tree and then training it using the CART [35] algorithm without pruning. The random selection of samples contributes in avoiding overfitting. Once the model has been trained, an evaluation phase is performed, where only the values of the different inputs are considered, and the algorithm provides the output. Then, the output of the model and the original are compared in order to estimate the accuracy of the model.  
In the ML scheme proposed in this paper, the labeled samples are collected in the UEs and transmitted to a server located at the network edge, where different datasets are collected. The collection of different datasets helps the KPI to S-KPI mapping by capturing the effects of contextual variables. The ML process is executed in a server, and the estimator is used by the MN to predict the S-KPI. In particular, the inputs of the algorithm are the SINR, the modulation index and the reception success, as previously indicated in Section 3.2. The output will be the E2E latency experienced by the URLLC devices.