# Machine Learning-Based Methods for Enhancement of UAV-NOMA and D2D Cooperative Networks
## 4 ANN-Based Placement Scheme Selection
### Data Pre-Processing  
The effectiveness of an ANN is highly dependent on the quantity and quality of training data. Consequently, regardless of which classifier is used, inferior models are generated if the training data are inaccurate. In light of the above assertion, stratified sampling and data normalization procedures are utilized to obtain the most incredible performance of the ANN model.  
As an essential data pre-processing step, instance selection is employed not only to cope with the infeasibility of learning from massive data sets, but also to reduce the risk of the ANN model tending towards the majority and avoid coming up with what is known as the accuracy paradox [38]. For this purpose, stratifying sampling is applied. Hence, the overall training set is reduced, and the class values are uniformly distributed in the training sets, as shown in Figure 3. After removing redundant instances per class values, 3000 data samples were collected, which means a 50% reduction of the initial 6000 raw data samples. In addition, an ANN model cannot attain optimal performance if the feature values are in different units and scales.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Feature** & **Description** \\ \hline \multirow{2}{*}{\(D_{\text{Ptc}}\)} & The sum of distances between each \(\text{GMT}_{l}\)\((1\leq l\leq N)\) and the UFBS located in the \\  & centroid point \(p_{1}^{\text{tr}}\in A\) \\ \hline \multirow{2}{*}{\(D_{\text{Pttm}}\)} & The sum of distances between each \(\text{GMT}_{l}\)\((1\leq l\leq N)\) and the UFBS located in the \\  & medoid point \(p_{1}^{\text{tr}}\in A\) \\ \hline \(r_{\text{min}}^{p_{1}^{\text{tr}}}\) & The minimum 2D distance of the GMTs from the point \(p_{1}^{\text{tr}}\in A\) \\ \hline \(r_{\text{max}}^{p_{2}^{\text{tr}}}\) & The maximum 2D distance of the GMTs from the point \(p_{1}^{\text{tr}}\in A\) \\ \hline \(r_{\text{min}}^{p_{m}^{\text{tr}}}\) & The minimum 2D distance of the GMTs from the point \(p_{1}^{\text{tr}}\in A\) \\ \hline \(r_{\text{max}}^{p_{m}^{\text{tr}}}\) & The maximum 2D distance of the GMTs from the point \(p_{1}^{\text{tr}}\in A\) \\ \hline \(\text{PL}_{\text{sum}}^{p_{i}}\) & The sum of the propagation losses of the GMTs in the case of placing the UFBS at the \\  & point \(p_{1}^{\text{tr}}\in A\) \\ \hline \(\text{PL}_{\text{sum}}^{p_{m}}\) & The sum of the propagation losses of the GMTs in the case of placing the UFBS at the \\  & point \(p_{1}^{\text{tr}}\in A\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: The features utilized in the developed ANN model.  
In order to resolve these challenges, it is necessary to use a normalizing technique that eliminates the effects of those mismatches. Using this approach, the values of the dataset's features are scaled into a given range while keeping the original dataset's overall distribution and ratios. Hence, before the training phase, all input features were normalized for this purpose. The formula for normalizing is as follows:  
\[X_{\text{norm}}=\frac{X-X_{\text{min}}}{X_{\text{max}}-X_{\text{min}}} \tag{31}\]  
where \(X\) is a value of the corresponding feature under normalization, \(X_{\text{max}}\) and \(X_{\text{min}}\) are the maximum and the minimum value of this feature, respectively, and \(X_{\text{norm}}\in[0,1]\) is the final normalized value [37].