## 5 Proposed Model
### An Enhanced Distributed and Adaptable PDP Model Based on ML Technology for Access Control
#### 5.2.3 Model Training  
The random-forest (RF) ensemble learning method is especially beneficial for constructing predictive models for classification and regression issues. Multiple learning models were trained concurrently using a group learning strategy to improve the Accuracyof predictions. Random Forest builds a whole forest of uncorrelated classification and regression trees to predict optimal outcomes.  
1. Repeat sampling with replacement was carried out on the complete training set Sample. The entire training set was partitioned into z subsets: Subsets 1, 2, 3...Subset z \(-\) 1. A subset n is the total number of datasets in the entire set and its subsets.
2. Each subset used for training has its own classification and regression tree (CART) and decision tree. In particular, m features were selected randomly from the complete set of attribute properties. After that, the optimal feature was applied from m to perform the division. Next, the new tree's node was subdivided according to the GINI value for the current m \(-\) 1 properties. Finally, GINI impurities were applied to the new tree nodes until the leaves of the tree could not be divided any further.
3. There are obtained \(L\) classification and regression tree (CART) decision trees that correspond to train data of subsets. Every CART tree will produce one decision outcome for the input parameter (\(T_{\text{i}}\)). For example, if the decision result was access-allowed, the tree's Decision Result (\(T_{\text{i}}\)) value was 1.0. The aggregate vote then generated the conclusions reached by each of the decision trees in their totality. \[Vote(v)=\sum_{i=1}^{L}Result Decision(T_{\text{i}})\] (9)
4. The final authorization decision formula was obtained based on the input user characteristics as follows: \[Authorization\ (access\ request)=\begin{cases}1&\frac{Vote(v)}{L}>0.5\\ 0&\frac{Vote(v)}{L}\leq 0.5\end{cases}\] (10)  
The user can access the requested object if authorization (access request) equals 1. If not, access is denied. By separating the nodes, the CART tree purifies the data, and its results will be more accurate than the real number. In the classification problem, the _GINI_ result measures the purity of the tree's nodes. As a general rule, _GINI_ scores are calculated in the following manner:  
\[GINI=1-\sum_{i=1}^{c}(pi)^{2} \tag{11}\]  
The influence of the division method intensifies as _GINI_ increases. For this reason, the child node with the lowest _GINI_ score can be used as the basis for splitting the classification tree. Overfitting is also minimized by simplifying the decision tree using the cost-complexity strategy. If a non-leaf node has less than one surface gain, then cost complexity will eliminate its left and right children. In cases where the minimal surface error gain is the same for many non-leaf nodes, the node with the fewest leaves is selected for elimination. In order to calculate the surface error gain, use the following formula:  
\[E(T)=\sum_{i}^{m}e_{\text{i}}(t)\cdot p_{\text{i}}(t),\alpha=\frac{E(t)-E(T)} {N(T)-1} \tag{12}\]  
in which \(E(t)\) represents the error overhead at the leaf level, the node's error rate, \(e(t)\), is calculated as \(E(t)=e(t)\ p(t)\), Error cost (\(E(T)\)), data node ratio (\(p(t)\)), child node error rate (\(e_{\text{i}}(t)\)), data node ratio (\(p_{\text{i}}(t)\)), and subtree node count (\(N(T)\)) are all variables.